Ticket #2137: test.cpp

File test.cpp, 603 bytes (added by john.femiani@…, 14 years ago)

Sourcecode that produces the error.

Line 
1#include <iostream>
2#include <boost/concept_check.hpp>
3#include <boost/concept/requires.hpp>
4
5
6template <typename T>
7struct foo
8{ };
9
10
11template <class X>
12struct DummyConcept
13{
14 typedef typename X::something something;
15
16 BOOST_CONCEPT_USAGE(DummyConcept){
17 }
18};
19
20
21template<typename T>
22 BOOST_CONCEPT_REQUIRES(
23 ((DummyConcept<T>)),
24 (void))
25func(T&)
26{ std::cout << "first overload" << std::endl; }
27
28template<typename T>
29 void func(foo<T>)
30 { std::cout << "second overload" << std::endl; }
31
32
33int main()
34{
35 func(foo<int>());
36 return 0;
37}
38