Date: Fri, 25 Apr 2025 10:26:57 +0100
On Fri, 25 Apr 2025 at 09:26, Simon Schröder via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> BTW, knowing yvals_core.h is a weird flex. I bet that almost no one knows this file. You also should not learn good style from STL implementations. Most of them are quite old, written against the C++98 standard. Also, these libraries are doing things that are forbidden for the normal programmer (leading double underscores are reserved for library use!). Most likely they also heavily use macros. With modern C++ there are a lot less reasons to use macros. And you should certainly avoid macros if you can. Also, these libraries put performance (with a valid reason) above readability. Unless you have a reason to do so (always measure, don’t just assume) you should write your own code for readability/maintainability.
Yes, you should not be using things like _EXPORT_STD in your code,
just use a namespace declaration, not an internal macro that's part of
the Microsoft implementation. And you should not be adding anything to
namespace std, since what you're implementing is not actually part of
the standard - define your own namespace for your own types.
But even with those details fixed, this just isn't something we need
in the C++ standard.
<std-proposals_at_[hidden]> wrote:
> BTW, knowing yvals_core.h is a weird flex. I bet that almost no one knows this file. You also should not learn good style from STL implementations. Most of them are quite old, written against the C++98 standard. Also, these libraries are doing things that are forbidden for the normal programmer (leading double underscores are reserved for library use!). Most likely they also heavily use macros. With modern C++ there are a lot less reasons to use macros. And you should certainly avoid macros if you can. Also, these libraries put performance (with a valid reason) above readability. Unless you have a reason to do so (always measure, don’t just assume) you should write your own code for readability/maintainability.
Yes, you should not be using things like _EXPORT_STD in your code,
just use a namespace declaration, not an internal macro that's part of
the Microsoft implementation. And you should not be adding anything to
namespace std, since what you're implementing is not actually part of
the standard - define your own namespace for your own types.
But even with those details fixed, this just isn't something we need
in the C++ standard.
Received on 2025-04-25 09:27:14