Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a1e581

Browse files
committed
MSVC2015 seems to need an explicit operator== for comparing against literal strings.
1 parent 4f30e3a commit 2a1e581

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/behaviortree_cpp_v3/utils/string_view.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,14 @@ nssv_constexpr bool operator== (
891891
basic_string_view <CharT, Traits> rhs ) nssv_noexcept
892892
{ return lhs.compare( rhs ) == 0 ; }
893893

894+
template< class CharT, class Traits >
895+
nssv_constexpr bool operator== (
896+
basic_string_view <CharT, Traits> lhs,
897+
CharT const * rhs) nssv_noexcept
898+
{
899+
return lhs.compare(rhs) == 0;
900+
}
901+
894902
template< class CharT, class Traits >
895903
nssv_constexpr bool operator!= (
896904
basic_string_view <CharT, Traits> lhs,

0 commit comments

Comments
 (0)