Compare commits

...

7 Commits

Author SHA1 Message Date
Beman Dawes
7c5fea0a00 Release 1.43.0 beta 1
[SVN r61461]
2010-04-21 14:13:35 +00:00
Daniel James
13da21e7b1 Revert changes to result_of. Reopens #862, #1310, #1535.
[SVN r61149]
2010-04-08 21:59:33 +00:00
Niels Dekker
b3ffef536d Merged std_bitset.cpp (boost::swap test) from trunk r60292 through r60334 and r61065 through r61076, including #3984 fix.
[SVN r61077]
2010-04-05 19:21:12 +00:00
Daniel James
e2c98762db Revert [60052] as it isn't as uncontroversial as I thought.
[SVN r60314]
2010-03-07 16:22:34 +00:00
Daniel James
8af4250c3c Suppress/fix some msvc and gcc compiler warnings ([57494]).
[SVN r60291]
2010-03-07 12:13:29 +00:00
Daniel James
e30889304c Merge some tests for unwrap ([47296], [47297])
[SVN r60290]
2010-03-07 12:11:44 +00:00
Daniel James
b4dee80e61 Merge various result_of changes.
- [42234] Reduce header dependencies, from Shunsuke Sogame. Fixes #1535
 - [45256] result_of implementation that makes use of C++0x decltype, from Daniel Walker. Fixes #862.
 - [48620] Fix result_of to work with const-qualified function pointers. Fixes #1310
 - [60052] Remove use of deprecated config macro in result_of.



[SVN r60289]
2010-03-07 12:08:00 +00:00
7 changed files with 63 additions and 9 deletions

View File

@@ -281,7 +281,7 @@ object_id_compare::operator ()
} }
else else
{ {
return a.second->before( *b.second ); return a.second->before( *b.second ) != 0;
} }
} }
} }

View File

@@ -11,6 +11,10 @@
#include <algorithm> #include <algorithm>
#include <cstddef> #include <cstddef>
#ifdef BOOST_MSVC
#pragma warning(disable:4996) // warning C4996: 'std::equal': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
#endif
/* /*
Note: This file tests every single valid bit-grouping on its own, and some Note: This file tests every single valid bit-grouping on its own, and some
random combinations of bit-groupings. random combinations of bit-groupings.

View File

@@ -21,6 +21,10 @@
#include <libs/type_traits/test/test.hpp> #include <libs/type_traits/test/test.hpp>
#include <libs/type_traits/test/check_type.hpp> #include <libs/type_traits/test/check_type.hpp>
#ifdef BOOST_MSVC
#pragma warning(disable:4181) // : warning C4181: qualifier applied to reference type; ignored
#endif
// a way prevent warnings for unused variables // a way prevent warnings for unused variables
template<class T> inline void unused_variable(const T&) {} template<class T> inline void unused_variable(const T&) {}
@@ -52,7 +56,8 @@ struct contained
const_reference const_get()const { return v_; } const_reference const_get()const { return v_; }
// pass value: // pass value:
void call(param_type){} void call(param_type){}
private:
contained& operator=(const contained&);
}; };
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
@@ -77,6 +82,8 @@ struct contained<T[N]>
reference get() { return v_; } reference get() { return v_; }
const_reference const_get()const { return v_; } const_reference const_get()const { return v_; }
void call(param_type){} void call(param_type){}
private:
contained& operator=(const contained&);
}; };
#endif #endif
@@ -197,7 +204,7 @@ struct comparible_UDT
bool operator == (const comparible_UDT& v){ return v.i_ == i_; } bool operator == (const comparible_UDT& v){ return v.i_ == i_; }
}; };
int main(int argc, char *argv[ ]) int main()
{ {
call_traits_checker<comparible_UDT> c1; call_traits_checker<comparible_UDT> c1;
comparible_UDT u; comparible_UDT u;

View File

@@ -68,11 +68,54 @@ struct ref_wrapper
} }
}; };
struct copy_counter {
static int count_;
copy_counter(copy_counter const& /*other*/) {
++count_;
}
copy_counter() {}
static void reset() { count_ = 0; }
static int count() { return copy_counter::count_; }
};
int copy_counter::count_ = 0;
} // namespace unnamed } // namespace unnamed
template <class T>
void do_unwrap(T t) {
/* typename unwrap_reference<T>::type& lt = */
unwrap_ref(t);
}
void unwrap_test() {
int i = 3;
const int ci = 2;
do_unwrap(i);
do_unwrap(ci);
do_unwrap(ref(i));
do_unwrap(cref(ci));
do_unwrap(ref(ci));
copy_counter cc;
BOOST_CHECK(cc.count() == 0);
do_unwrap(cc);
do_unwrap(ref(cc));
do_unwrap(cref(cc));
BOOST_CHECK(cc.count() == 1);
BOOST_CHECK(unwrap_ref(ref(cc)).count() == 1);
}
int test_main(int, char * []) int test_main(int, char * [])
{ {
ref_wrapper<int>::test(1); ref_wrapper<int>::test(1);
ref_wrapper<int const>::test(1); ref_wrapper<int const>::test(1);
unwrap_test();
return 0; return 0;
} }

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2008 Joseph Gauterin, Niels Dekker // Copyright (c) 2008 - 2010 Joseph Gauterin, Niels Dekker
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -17,8 +17,8 @@
int test_main(int, char*[]) int test_main(int, char*[])
{ {
typedef std::bitset<8> bitset_type; typedef std::bitset<8> bitset_type;
const bitset_type initial_value1 = 1ul; const bitset_type initial_value1 = 1;
const bitset_type initial_value2 = 2ul; const bitset_type initial_value2 = 2;
bitset_type object1 = initial_value1; bitset_type object1 = initial_value1;
bitset_type object2 = initial_value2; bitset_type object2 = initial_value2;

0
test/next_prior_test.cpp Executable file → Normal file
View File

View File

@@ -29,9 +29,9 @@
// //
struct POD struct POD
{ {
POD () : c(0), i(0), f(0) {} POD () : f(0), c(0), i(0){}
POD ( char c_, int i_, float f_ ) : c(c_), i(i_), f(f_) {} POD ( char c_, int i_, float f_ ) : f(f_), c(c_), i(i_) {}
friend std::ostream& operator << ( std::ostream& os, POD const& pod ) friend std::ostream& operator << ( std::ostream& os, POD const& pod )
{ return os << '(' << pod.c << ',' << pod.i << ',' << pod.f << ')' ; } { return os << '(' << pod.c << ',' << pod.i << ',' << pod.f << ')' ; }
@@ -291,7 +291,7 @@ int test_main(int, char **)
{ {
BOOST_CHECK ( test( 0,1234 ) ) ; BOOST_CHECK ( test( 0,1234 ) ) ;
BOOST_CHECK ( test( 0.0,12.34 ) ) ; BOOST_CHECK ( test( 0.0,12.34 ) ) ;
BOOST_CHECK ( test( POD(0,0,0.0), POD('a',1234,56.78) ) ) ; BOOST_CHECK ( test( POD(0,0,0.0), POD('a',1234,56.78f) ) ) ;
BOOST_CHECK ( test( NonPOD( std::string() ), NonPOD( std::string("something") ) ) ) ; BOOST_CHECK ( test( NonPOD( std::string() ), NonPOD( std::string("something") ) ) ) ;
NonPOD NonPOD_object( std::string("NonPOD_object") ); NonPOD NonPOD_object( std::string("NonPOD_object") );