Skip to content

Commit

Permalink
c++14 constexpr fixes for environment_win.
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Jul 12, 2024
1 parent 414d0d6 commit 8044857
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/boost/process/v2/detail/environment_win.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct key_char_traits
return to_lower(c1) < to_lower(c2);
}

BOOST_CONSTEXPR static
BOOST_CXX14_CONSTEXPR static
int compare(const char_type* s1, const char_type* s2, size_t n) BOOST_NOEXCEPT
{
auto itrs = std::mismatch(s1, s1 + n, s2, &eq);
Expand All @@ -69,17 +69,17 @@ struct key_char_traits
return (c1 < c2 ) ? -1 : 1;
}

BOOST_CONSTEXPR static size_t length(const char* s) BOOST_NOEXCEPT { return std::strlen(s); }
BOOST_CONSTEXPR static size_t length(const wchar_t* s) BOOST_NOEXCEPT { return std::wcslen(s); }
static size_t length(const char* s) BOOST_NOEXCEPT { return std::strlen(s); }
static size_t length(const wchar_t* s) BOOST_NOEXCEPT { return std::wcslen(s); }

BOOST_CONSTEXPR static
BOOST_CXX14_CONSTEXPR static
const char_type* find(const char_type* s, size_t n, const char_type& a) BOOST_NOEXCEPT
{
const char_type u = to_lower(a);
return std::find_if(s, s + n, [u](char_type c){return to_lower(c) == u;});
}

BOOST_CONSTEXPR static
BOOST_CXX14_CONSTEXPR static
char_type* move(char_type* s1, const char_type* s2, size_t n) BOOST_NOEXCEPT
{
if (s1 < s2)
Expand All @@ -94,7 +94,7 @@ struct key_char_traits
return std::copy(s2, s2 + n, s1);
}

BOOST_CONSTEXPR static
BOOST_CXX14_CONSTEXPR static
char_type* assign(char_type* s, size_t n, char_type a) BOOST_NOEXCEPT
{
std::fill(s, s + n, a);
Expand Down

0 comments on commit 8044857

Please sign in to comment.