mirror of
https://github.com/boostorg/mpl.git
synced 2026-05-04 11:44:10 +02:00
1) 'Not found' result is void_; 2) Uses refactored find_if_pred.
[SVN r20714]
This commit is contained in:
+6
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user