I do not see a big problem with undefined behavior. You use #if to check in C ++ 17, and you know any there before. If you really want this, I say, go after it and put an alias in std if it is earlier than C ++ 17.
At the end of the day, the helper functions / classes / etc will most likely be placed in another namespace or with the __ prefix, as this is available for standard libraries. I do not think that the pre-C ++ 17 implementation exports any to std.
There is no other way. Just ignore the "undefined behavior" and go if that works. There is nothing magical about destroying your code; the worst that can happen is the failed implementation of std, and it does not compile when defining an alias. In my opinion, some people face undefined behavior problems.
kktsuri
source share