Fix weird clang link error

This commit is contained in:
Krystian Stasiowski
2020-02-21 15:37:22 -05:00
parent 1c4184198b
commit 38185d5942
2 changed files with 51 additions and 44 deletions

View File

@ -927,7 +927,14 @@ public:
*/
BOOST_STATIC_STRING_CPP14_CONSTEXPR
basic_static_string&
assign(const basic_static_string& s) noexcept;
assign(const basic_static_string& s) noexcept
{
if (this == &s)
return *this;
this->set_size(s.size());
traits_type::copy(data(), &s.data()[0], size() + 1);
return *this;
}
/** Replace the contents.
@ -942,8 +949,8 @@ public:
assign(const basic_static_string<M, CharT, Traits>& s)
{
// VFALCO this could come in two flavors,
// N>M and N<M, and skip the exception
// check when N>M
// N > M and N < M, and skip the exception
// check when N > M
return assign(s.data(), s.size());
}
@ -4781,19 +4788,19 @@ assign(
return term();
}
template<std::size_t N, typename CharT, typename Traits>
BOOST_STATIC_STRING_CPP14_CONSTEXPR
auto
basic_static_string<N, CharT, Traits>::
assign(const basic_static_string& s) noexcept ->
basic_static_string&
{
if(this == &s)
return *this;
this->set_size(s.size());
traits_type::copy(data(), &s.data()[0], size() + 1);
return *this;
}
//template<std::size_t N, typename CharT, typename Traits>
//BOOST_STATIC_STRING_CPP14_CONSTEXPR
//auto
//basic_static_string<N, CharT, Traits>::
//assign(const basic_static_string& s) noexcept ->
// basic_static_string&
//{
// if(this == &s)
// return *this;
// this->set_size(s.size());
// traits_type::copy(data(), &s.data()[0], size() + 1);
// return *this;
//}
template<std::size_t N, typename CharT, typename Traits>
template<std::size_t M>

View File

@ -7042,37 +7042,37 @@ testOperatorPlus()
BOOST_TEST(res.size() == 10);
}
//// operator+(static_string, CharT)
//{
// auto res = s1 + '!';
// BOOST_TEST(res == "hello!");
// BOOST_TEST(res.capacity() == 11);
// BOOST_TEST(res.size() == 6);
//}
// operator+(static_string, CharT)
{
auto res = s1 + '!';
BOOST_TEST(res == "hello!");
BOOST_TEST(res.capacity() == 11);
BOOST_TEST(res.size() == 6);
}
//// operator+(CharT, static_string)
//{
// auto res = '!' + s1;
// BOOST_TEST(res == "!hello");
// BOOST_TEST(res.capacity() == 11);
// BOOST_TEST(res.size() == 6);
//}
// operator+(CharT, static_string)
{
auto res = '!' + s1;
BOOST_TEST(res == "!hello");
BOOST_TEST(res.capacity() == 11);
BOOST_TEST(res.size() == 6);
}
//// operator+(static_string, CharT(&)[N])
//{
// auto res = s1 + "world";
// BOOST_TEST(res == "helloworld");
// BOOST_TEST(res.capacity() == 15);
// BOOST_TEST(res.size() == 10);
//}
// operator+(static_string, CharT(&)[N])
{
auto res = s1 + "world";
BOOST_TEST(res == "helloworld");
BOOST_TEST(res.capacity() == 15);
BOOST_TEST(res.size() == 10);
}
//// operator+(CharT(&)[N], static_string)
//{
// auto res = "hello" + s2;
// BOOST_TEST(res == "helloworld");
// BOOST_TEST(res.capacity() == 15);
// BOOST_TEST(res.size() == 10);
//}
// operator+(CharT(&)[N], static_string)
{
auto res = "hello" + s2;
BOOST_TEST(res == "helloworld");
BOOST_TEST(res.capacity() == 15);
BOOST_TEST(res.size() == 10);
}
}
int