1) 'Not found' result is void_; 2) Uses refactored find_if_pred.

[SVN r20714]
This commit is contained in:
Eric Friedman
2003-11-07 03:49:58 +00:00
parent d934b4944f
commit 4687267d09
2 changed files with 10 additions and 25 deletions
+6 -4
View File
@@ -18,6 +18,7 @@
#include "boost/static_assert.hpp"
#include "boost/mpl/list.hpp"
#include "boost/mpl/void.hpp"
namespace mpl = boost::mpl;
@@ -30,10 +31,11 @@ int test_main(int , char* [])
typedef mpl::index_of< types, float >::type index_of_float;
typedef mpl::index_of< types, char >::type index_of_char;
BOOST_STATIC_ASSERT( index_of_int::value == 0 );
BOOST_STATIC_ASSERT( index_of_double::value == 1 );
BOOST_STATIC_ASSERT( index_of_float::value == 2 );
BOOST_STATIC_ASSERT( index_of_char::value == -1 ); // 'not found'
BOOST_STATIC_ASSERT(( index_of_int::value == 0 ));
BOOST_STATIC_ASSERT(( index_of_double::value == 1 ));
BOOST_STATIC_ASSERT(( index_of_float::value == 2 ));
BOOST_STATIC_ASSERT(( mpl::is_void_< index_of_char >::value ));
return 0;
}