mirror of
https://github.com/boostorg/core.git
synced 2025-07-29 20:37:22 +02:00
g++ 11 has <memory_resource> but not std::pmr::string
This commit is contained in:
@ -9,6 +9,9 @@
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
# include <string_view>
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
|
||||
# include <memory_resource>
|
||||
#endif
|
||||
|
||||
template<class It> std::reverse_iterator<It> make_reverse_iterator( It it )
|
||||
{
|
||||
@ -304,7 +307,9 @@ int main()
|
||||
#if !defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
|
||||
|
||||
{
|
||||
std::pmr::string str = "123";
|
||||
using pmr_string = std::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char>>;
|
||||
|
||||
pmr_string str = "123";
|
||||
|
||||
boost::core::string_view sv( str );
|
||||
|
||||
|
@ -8,6 +8,9 @@
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
# include <string_view>
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
|
||||
# include <memory_resource>
|
||||
#endif
|
||||
|
||||
boost::core::string_view f( boost::core::string_view const& str )
|
||||
{
|
||||
@ -37,8 +40,10 @@ int main()
|
||||
#if !defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
|
||||
|
||||
{
|
||||
std::pmr::string s1( "123" );
|
||||
std::pmr::string s2 = f( s1 );
|
||||
using pmr_string = std::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char>>;
|
||||
|
||||
pmr_string s1( "123" );
|
||||
pmr_string s2 = f( s1 );
|
||||
|
||||
BOOST_TEST_EQ( s1, s2 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user