]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/icl/test/fix_include_after_thread_/fix_include_after_thread.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / icl / test / fix_include_after_thread_ / fix_include_after_thread.cpp
1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2011-2011: Joachim Faulhaber
3 +------------------------------------------------------------------------------+
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENCE.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 +-----------------------------------------------------------------------------*/
8 //JODO REMOVE THIS TESTCASE
9
10 #define BOOST_TEST_MODULE icl::fix_include_after_thread unit test
11 #include <boost/config.hpp>
12 #include <boost/test/unit_test.hpp>
13
14 //Problem: If <boost/thread.hpp> is included before this
15 //example code, it influences compilation: Code that has
16 //compiled well, produces a syntax error error C2059 under
17 //msvc-9/10. This can be fixed by enclosing subexpressions
18 //like some_attribute<Type>::value in parentheses
19 // ->(some_attribute<Type>::value)
20 //The problem does not occur for gcc compilers.
21
22 // #include <boost/thread.hpp> MEMO: The problem occured when using thread.hpp
23 #include <boost/bind.hpp> // but is also triggered from bind.hpp alone
24 // while the cause of it is an error in the msvc-7.1 to 10.0 compilers.
25 // A minimal example is provided by test case 'cmp_msvc_value_born_error'
26
27 //--- included code ---------------------------------------
28 template <class Type> struct some_attribute
29 {
30 BOOST_STATIC_CONSTANT(int, value = 0);
31 };
32
33 template <class Type> struct some_predicate
34 {
35 BOOST_STATIC_CONSTANT(bool,
36 value = ((some_attribute<Type>::value) < 0)
37 // value = ( some_attribute<Type>::value < 0)
38 //error C2059: syntax error : ')' ONLY
39 //IF <boost/thread.hpp> is included before
40 );
41 };
42 //--- end of included code --------------------------------
43
44 BOOST_AUTO_TEST_CASE(dummy)
45 {
46 BOOST_CHECK(true);
47 }
48