On 13/03/2017 12:49, Vic Luo wrote:
This is a long known issue. You should implement your own string comparison routine which is constexpr. As you mention, Boost's string_view is constrained by the STL's implementation of char_traits.
Would it be OK to implement our own constexpr char_traits(just replace ::compare, ::length), then use boost::basic_string_view
as our CONSTEXPR_STRING_VIEW and compare views with constexpr boost::string_view::compare(a, b) == 0? This way seems to work on my g++-6 which prevents reinventing the wheel.
That's definitely one approach, if you're set on using string_view. I had thought there was a proposed constexpr string container around, but as nobody's mentioned anything, I guess string_view has superseded it. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/