How do I make a constexpr swap function?
I'm making my own String View class for learning purposes, and I'm trying to make it 100% constexpr. To test it, I have a member function that returns an hash value. I then construct my string view in a switch statement and call that same member function, if it passes, that member function has fullfiled its purpose. To learn, I'm using / reading / comparing my implementation with Visual Studio 2017 latest update std::string_view , however, I've noticed that, despite swap being marked as constexpr , it does not work, nor in Visual Studio, nor in g++. This is the piece of code that does not work