mirror of
https://github.com/boostorg/typeof.git
synced 2025-11-17 07:59:24 +01:00
added more tests
[SVN r31048]
This commit is contained in:
32
test/noncopyable.cpp
Executable file
32
test/noncopyable.cpp
Executable file
@@ -0,0 +1,32 @@
|
||||
#include "test.hpp"
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct x : boost::noncopyable
|
||||
{
|
||||
void foo() {}
|
||||
void bar() const {}
|
||||
};
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
|
||||
x& make_ref()
|
||||
{
|
||||
static x result;
|
||||
return result;
|
||||
}
|
||||
|
||||
const x& make_const_ref()
|
||||
{
|
||||
static x result;
|
||||
return result;
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
BOOST_AUTO(& v1, make_ref());
|
||||
v1.foo();
|
||||
|
||||
BOOST_AUTO(const& v2, make_const_ref());
|
||||
v2.bar();
|
||||
}
|
||||
Reference in New Issue
Block a user