VC6 compatibility fixes

[SVN r20564]
This commit is contained in:
Fernando Cacciola
2003-10-30 14:45:13 +00:00
parent 65464ceffd
commit 9adda8450b
3 changed files with 39 additions and 5 deletions

View File

@ -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) {}
@ -67,7 +71,13 @@ int test_main( int, char* [] )
return 0;
}
#else
int test_main( int, char* [] )
{
// If in-place factories are not supported there is nothing to test
return 0 ;
}
#endif

View File

@ -19,7 +19,10 @@
#define BOOST_ENABLE_ASSERT_HANDLER
#include "boost/optional.hpp"
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
#include "boost/utility/in_place_factory.hpp"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
@ -29,6 +32,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) {}
@ -47,5 +51,13 @@ int test_main( int, char* [] )
return 0;
}
#else
int test_main( int, char* [] )
{
int invalid_extra_parameter ;
boost::optional<A> opt2 ( A(3.14,"pi",invalid_extra_parameter) ) ;
return 0;
}
#endif

View File

@ -19,7 +19,10 @@
#define BOOST_ENABLE_ASSERT_HANDLER
#include "boost/optional.hpp"
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
#include "boost/utility/typed_in_place_factory.hpp"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
@ -29,6 +32,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) {}
@ -49,5 +53,13 @@ int test_main( int, char* [] )
return 0;
}
#else
int test_main( int, char* [] )
{
boost::optional<A> opt2 ( int(3.14) ) ;
return 0;
}
#endif