mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 20:04:29 +02:00
Add a small test to see if the tested compilers support out of line template methods.
[SVN r55992]
This commit is contained in:
@@ -38,4 +38,5 @@ test-suite unordered
|
|||||||
[ run rehash_tests.cpp ]
|
[ run rehash_tests.cpp ]
|
||||||
[ run equality_tests.cpp ]
|
[ run equality_tests.cpp ]
|
||||||
[ run swap_tests.cpp : : : <define>BOOST_UNORDERED_SWAP_METHOD=2 ]
|
[ run swap_tests.cpp : : : <define>BOOST_UNORDERED_SWAP_METHOD=2 ]
|
||||||
|
[ run out_of_line.cpp ]
|
||||||
;
|
;
|
||||||
|
21
test/unordered/out_of_line.cpp
Normal file
21
test/unordered/out_of_line.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
// Just a little test to see if out of line template methods are supported:
|
||||||
|
|
||||||
|
#include <boost/detail/lightweight_test.hpp>
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct foo {
|
||||||
|
template <class U>
|
||||||
|
bool bar(U x);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
template <class U>
|
||||||
|
bool foo<T>::bar(U x) { return x; }
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
foo<int> x;
|
||||||
|
BOOST_TEST(x.bar(1));
|
||||||
|
BOOST_TEST(!x.bar(0));
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user