~barry/ubuntu/precise/boost1.46/debian-merge

« back to all changes in this revision

Viewing changes to libs/icl/test/cmp_msvc_value_born_error_/cmp_msvc_value_born_error.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2011-03-13 00:37:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110313003735-r7j6jdk0hkywfzuw
Tags: 1.46.1-1
* New upstream.

* control: Add libboost-random1.46-dev to depends of -all-dev and
  suggests of -dev.  Closes: #615849.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
#define BOOST_TEST_MODULE icl::cmp_msvc_value_born_error unit test
 
9
#include <boost/config.hpp>
 
10
#include "../unit_test_unwarned.hpp"
 
11
 
 
12
namespace unhelpful{
 
13
    // This declaration of a class template will cause
 
14
    // the compilation of line 17 to fail with syntax error C2059
 
15
    template<class T> class value{};
 
16
}
 
17
 
 
18
//--- affected code ---------------------------------------
 
19
template <class Type> struct meta_attribute
 
20
 
21
    BOOST_STATIC_CONSTANT(int, value = 0); 
 
22
};
 
23
 
 
24
template <class Type> struct meta_predicate
 
25
 
26
    BOOST_STATIC_CONSTANT(bool, value = 
 
27
        ( meta_attribute<Type>::value  < 1)
 
28
        //error C2059: syntax error : ')'
 
29
        //IF class template value declared before
 
30
    //  ((meta_attribute<Type>::value) < 1) // Remedy#1 enclose into ()
 
31
    //  ( meta_attribute<Type>::value  <=0) // Remedy#2 use operator <= 
 
32
        );
 
33
};
 
34
 
 
35
BOOST_AUTO_TEST_CASE(dummy)
 
36
{
 
37
    BOOST_CHECK( meta_predicate<int>::value );
 
38
}
 
39