Add explicit template instantiation strings for different char types. add operator _ss overloads for different char types
This commit is contained in:
parent
f7b0822dd2
commit
d98c40dac8
@ -28,6 +28,9 @@ namespace rexy{
|
|||||||
using string = basic_string<char,detail::default_allocator<char>>;
|
using string = basic_string<char,detail::default_allocator<char>>;
|
||||||
|
|
||||||
extern template class basic_string<char,detail::default_allocator<char>>;
|
extern template class basic_string<char,detail::default_allocator<char>>;
|
||||||
|
extern template class basic_string<wchar_t,detail::default_allocator<wchar_t>>;
|
||||||
|
extern template class basic_string<char16_t,detail::default_allocator<char16_t>>;
|
||||||
|
extern template class basic_string<char32_t,detail::default_allocator<char32_t>>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -306,6 +306,16 @@ namespace{
|
|||||||
constexpr inline rexy::static_string<char> operator"" _ss(const char* str, size_t len)noexcept{
|
constexpr inline rexy::static_string<char> operator"" _ss(const char* str, size_t len)noexcept{
|
||||||
return rexy::static_string<char>(str, len);
|
return rexy::static_string<char>(str, len);
|
||||||
}
|
}
|
||||||
|
constexpr inline rexy::static_string<wchar_t> operator"" _ss(const wchar_t* str, size_t len)noexcept{
|
||||||
|
return rexy::static_string<wchar_t>(str, len);
|
||||||
|
}
|
||||||
|
constexpr inline rexy::static_string<char16_t> operator"" _ss(const char16_t* str, size_t len)noexcept{
|
||||||
|
return rexy::static_string<char16_t>(str, len);
|
||||||
|
}
|
||||||
|
constexpr inline rexy::static_string<char32_t> operator"" _ss(const char32_t* str, size_t len)noexcept{
|
||||||
|
return rexy::static_string<char32_t>(str, len);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REXY_BINARY_BASE_HPP
|
#ifdef REXY_BINARY_BASE_HPP
|
||||||
|
|||||||
@ -288,6 +288,10 @@ namespace rexy{
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern template class static_string<char>;
|
||||||
|
extern template class static_string<wchar_t>;
|
||||||
|
extern template class static_string<char16_t>;
|
||||||
|
extern template class static_string<char32_t>;
|
||||||
|
|
||||||
} //namespace rexy
|
} //namespace rexy
|
||||||
|
|
||||||
|
|||||||
28
src/static_string.cpp
Normal file
28
src/static_string.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
This file is a part of rexy's general purpose library
|
||||||
|
Copyright (C) 2020 rexy712
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "rexy/static_string.hpp"
|
||||||
|
|
||||||
|
namespace rexy{
|
||||||
|
|
||||||
|
template class static_string<char>;
|
||||||
|
template class static_string<wchar_t>;
|
||||||
|
template class static_string<char16_t>;
|
||||||
|
template class static_string<char32_t>;
|
||||||
|
|
||||||
|
}
|
||||||
@ -22,5 +22,8 @@
|
|||||||
namespace rexy{
|
namespace rexy{
|
||||||
|
|
||||||
template class basic_string<char,detail::default_allocator<char>>;
|
template class basic_string<char,detail::default_allocator<char>>;
|
||||||
|
template class basic_string<wchar_t,detail::default_allocator<wchar_t>>;
|
||||||
|
template class basic_string<char16_t,detail::default_allocator<char16_t>>;
|
||||||
|
template class basic_string<char32_t,detail::default_allocator<char32_t>>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user