Add test for ODR-use of ::in_place_* (refs #115)

This commit is contained in:
Peter Dimov
2023-12-15 02:11:19 +02:00
parent d8399efcac
commit ffa67ab005
3 changed files with 22 additions and 0 deletions

View File

@ -176,3 +176,4 @@ boost_test(TYPE run SOURCES result_and_fn1v.cpp)
boost_test(TYPE run SOURCES result_and_fn1r.cpp)
boost_test(TYPE run SOURCES result_and_eq_fn1v.cpp)
boost_test(TYPE run SOURCES result_and_eq_fn1r.cpp)
boost_test(TYPE run SOURCES result_in_place_use.cpp)

View File

@ -206,3 +206,4 @@ run result_and_fn1v.cpp : : : $(CPP11) ;
run result_and_fn1r.cpp : : : $(CPP11) ;
run result_and_eq_fn1v.cpp : : : $(CPP11) ;
run result_and_eq_fn1r.cpp : : : $(CPP11) ;
run result_in_place_use.cpp : : : $(CPP11) ;

View File

@ -0,0 +1,20 @@
// Copyright 2023 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/system.hpp>
#include <boost/core/lightweight_test.hpp>
template<class T, class U> void test( T const& t, U const& u )
{
BOOST_TEST_NE( static_cast<void const*>( &t ), static_cast<void const*>( &u ) );
}
int main()
{
using namespace boost::system;
test( result<int>::in_place_value, result<int>::in_place_error );
return boost::report_errors();
}