Date: Thu, 24 Apr 2025 18:30:53 -0500
Hi,
I'm slightly confused about your description and how you envision this
functionality working and what you're trying to achieve with it. As Jens
pointed out, this sounds a lot like std::any. The reason you might not have
heard of this or seen it used before is because it's of quite limited use
in C++. Unlike dynamic languages such as Python, C++ has no language
run-time that can handle dynamic types on the fly. Everything must be done
statically. While types like std::any exist and can let you store any
value, working with these can be quite cumbersome as you still have to
explicitly handle every possible type you care about.
> I know how to use the yvals_core.h file to make a custom
std-namespace-based file
I'm not quite sure what you mean by that but it sounds like something you
probably shouldn't be doing. It sounds like a good way to get UB.
Cheers,
Jeremy
On Thu, Apr 24, 2025 at 5:24 PM Paul Robert Stackhouse via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> Hello,
>
> I’m an up-and-coming programmer, who is making making their way through
> college. I am just about to complete an intro to C++ course. I have a few
> additions that I would like to propose. If needed, I can supply the code
> that I’ve worked on to make them a reality for myself.
>
> For some context, I know classes, templates, vectors, linked lists,
> recursion, etc. I know how to construct a variable from a class object and
> make it return different values by default, without using any class
> functions. I know about preprocessor directives, and I’ve seen some of the
> files for things like the iostream file, so I know how to use the
> yvals_core.h file to make a custom std-namespace-based file. That should
> provide you enough information to be able to see the capabilities of what
> I’ve made.
>
> As for what I’m recommending, it is a two-fold recommendation on making a
> universal variable type. The first is a universal value type. This can
> store any value inside itself and return any value stored in it to another
> variable. It is a universal value, since while it can store any individual
> value, it cannot store any structure of values. The other - and you’ll see
> how they are connected - is to make a universal storage type, that can
> store anything of any value inside itself. It would have to be able to
> store lists and vectors as well as maps, and it would have to be able to
> use only one set of storage for them. Additionally, as it would be a
> universal storage type, it would have to be able to store any individual
> values, like the universal value type. This would allow C++ to process
> complex and complicated documents with ease.
>
> Thank you for your consideration.
> paulrobert_at_[hidden]
>
> P.S.
> If the sender address looks like it does not match the actual email name
> of paulrobert_at_[hidden], that is intentional. I use the
> paulrobert_at_[hidden] name to create accounts, but any email sent to
> it gets redirected to the above email. I just thought I should let you know.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
I'm slightly confused about your description and how you envision this
functionality working and what you're trying to achieve with it. As Jens
pointed out, this sounds a lot like std::any. The reason you might not have
heard of this or seen it used before is because it's of quite limited use
in C++. Unlike dynamic languages such as Python, C++ has no language
run-time that can handle dynamic types on the fly. Everything must be done
statically. While types like std::any exist and can let you store any
value, working with these can be quite cumbersome as you still have to
explicitly handle every possible type you care about.
> I know how to use the yvals_core.h file to make a custom
std-namespace-based file
I'm not quite sure what you mean by that but it sounds like something you
probably shouldn't be doing. It sounds like a good way to get UB.
Cheers,
Jeremy
On Thu, Apr 24, 2025 at 5:24 PM Paul Robert Stackhouse via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> Hello,
>
> I’m an up-and-coming programmer, who is making making their way through
> college. I am just about to complete an intro to C++ course. I have a few
> additions that I would like to propose. If needed, I can supply the code
> that I’ve worked on to make them a reality for myself.
>
> For some context, I know classes, templates, vectors, linked lists,
> recursion, etc. I know how to construct a variable from a class object and
> make it return different values by default, without using any class
> functions. I know about preprocessor directives, and I’ve seen some of the
> files for things like the iostream file, so I know how to use the
> yvals_core.h file to make a custom std-namespace-based file. That should
> provide you enough information to be able to see the capabilities of what
> I’ve made.
>
> As for what I’m recommending, it is a two-fold recommendation on making a
> universal variable type. The first is a universal value type. This can
> store any value inside itself and return any value stored in it to another
> variable. It is a universal value, since while it can store any individual
> value, it cannot store any structure of values. The other - and you’ll see
> how they are connected - is to make a universal storage type, that can
> store anything of any value inside itself. It would have to be able to
> store lists and vectors as well as maps, and it would have to be able to
> use only one set of storage for them. Additionally, as it would be a
> universal storage type, it would have to be able to store any individual
> values, like the universal value type. This would allow C++ to process
> complex and complicated documents with ease.
>
> Thank you for your consideration.
> paulrobert_at_[hidden]
>
> P.S.
> If the sender address looks like it does not match the actual email name
> of paulrobert_at_[hidden], that is intentional. I use the
> paulrobert_at_[hidden] name to create accounts, but any email sent to
> it gets redirected to the above email. I just thought I should let you know.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2025-04-24 23:31:08