forked from boostorg/optional
VC6 compatibility fixes
[SVN r20564]
This commit is contained in:
@ -19,8 +19,11 @@
|
||||
#define BOOST_ENABLE_ASSERT_HANDLER
|
||||
|
||||
#include "boost/optional.hpp"
|
||||
|
||||
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
|
||||
#include "boost/utility/in_place_factory.hpp"
|
||||
#include "boost/utility/typed_in_place_factory.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
@ -30,6 +33,7 @@
|
||||
|
||||
#include "optional_test_common.cpp"
|
||||
|
||||
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
|
||||
struct A
|
||||
{
|
||||
A ( double a0, std::string a1 ) : m_a0(a0), m_a1(a1) {}
|
||||
@ -48,7 +52,7 @@ int test_main( int, char* [] )
|
||||
|
||||
A a0(a00,a01);
|
||||
A a1(a10,a11);
|
||||
|
||||
|
||||
boost::optional<A> opt1(a0);
|
||||
|
||||
boost::optional<A> opt2 ( boost::in_place(a00,a01) ) ;
|
||||
@ -61,13 +65,19 @@ int test_main( int, char* [] )
|
||||
|
||||
opt2 = boost::in_place(a10,a11);
|
||||
BOOST_CHECK( *opt2 == a1 ) ;
|
||||
|
||||
|
||||
opt3 = boost::in_place<A>(a10,a11);
|
||||
BOOST_CHECK( *opt3 == a1 ) ;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
int test_main( int, char* [] )
|
||||
{
|
||||
// If in-place factories are not supported there is nothing to test
|
||||
return 0 ;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user