stripped down implementation for Borland

[SVN r16531]
This commit is contained in:
Aleksey Gurtovoy
2002-12-08 08:08:01 +00:00
parent f873abf4a6
commit 99e829138f
2 changed files with 6 additions and 7 deletions

View File

@@ -15,18 +15,19 @@
// without express or implied warranty. // without express or implied warranty.
#include "boost/mpl/lower_bound.hpp" #include "boost/mpl/lower_bound.hpp"
#include "boost/mpl/distance.hpp"
#include "boost/mpl/list_c.hpp" #include "boost/mpl/list_c.hpp"
#include "boost/mpl/comparison/less.hpp" #include "boost/mpl/comparison/less.hpp"
#include "boost/mpl/int_c.hpp" #include "boost/mpl/int_c.hpp"
#include "boost/static_assert.hpp" #include "boost/static_assert.hpp"
namespace mpl = boost::mpl; namespace mpl = boost::mpl;
using mpl::_;
int main() int main()
{ {
typedef mpl::list_c<int,1,2,3,3,3,5,8> numbers; typedef mpl::list_c<int,1,2,3,3,3,5,8> numbers;
typedef mpl::lower_bound< numbers, mpl::int_c<3>, mpl::less<_,_> >::type iter; typedef mpl::lower_bound< numbers, mpl::int_c<3> >::type iter;
BOOST_STATIC_ASSERT((mpl::distance< mpl::begin<numbers>::type,iter >::type::value == 2)); BOOST_STATIC_ASSERT((mpl::distance< mpl::begin<numbers>::type,iter >::type::value == 2));
BOOST_STATIC_ASSERT(iter::type::value == 3);
return 0; return 0;
} }

View File

@@ -15,21 +15,19 @@
// without express or implied warranty. // without express or implied warranty.
#include "boost/mpl/upper_bound.hpp" #include "boost/mpl/upper_bound.hpp"
#include "boost/mpl/distance.hpp"
#include "boost/mpl/list_c.hpp" #include "boost/mpl/list_c.hpp"
#include "boost/mpl/comparison/less.hpp" #include "boost/mpl/comparison/less.hpp"
#include "boost/mpl/int_c.hpp" #include "boost/mpl/int_c.hpp"
#include "boost/mpl/distance.hpp"
#include "boost/static_assert.hpp" #include "boost/static_assert.hpp"
namespace mpl = boost::mpl; namespace mpl = boost::mpl;
using mpl::_;
#define N 50
int main() int main()
{ {
typedef mpl::list_c<int,1,2,3,3,3,5,8> numbers; typedef mpl::list_c<int,1,2,3,3,3,5,8> numbers;
typedef mpl::upper_bound< numbers, mpl::int_c<3>, mpl::less<_,_> >::type iter; typedef mpl::upper_bound< numbers, mpl::int_c<3> >::type iter;
BOOST_STATIC_ASSERT((mpl::distance< mpl::begin<numbers>::type,iter >::type::value == 5)); BOOST_STATIC_ASSERT((mpl::distance< mpl::begin<numbers>::type,iter >::type::value == 5));
BOOST_STATIC_ASSERT(iter::type::value == 5);
return 0; return 0;
} }