Consider that some library defines:
namespace NS {
constexpr atype operator ""_suffix(const char*, std::size_t);
};
If I don't like the name _suffix
(maybe it clashes with some other library, or it is in stark contrast with my naming convention): Am I able to "rename" the operator?
using _myalias = NS::operator ""_suffix`; // syntax error
using _myalias = NS::""_suffix`; // syntax error
using _myalias = NS::_suffix`; // undefined (`operator ""` is part of its name)
constexpr decltype(auto) operator ""_myalias(const char *str, std::size_t len)
{
return NS::operator ""_suffix(str, len); // very verbose, but it works
}
So, is there a simple syntax to define an alias for a user defined literal?