mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Fixed constraint helpers to be usable in any namespace
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@644 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
d2fbf4167b
commit
4faf23b2b1
1 changed files with 4 additions and 9 deletions
|
|
@ -18,6 +18,8 @@ namespace mock
|
|||
template< typename Constraint >
|
||||
struct constraint
|
||||
{
|
||||
constraint()
|
||||
{}
|
||||
constraint( const Constraint& c )
|
||||
: c_( c )
|
||||
{}
|
||||
|
|
@ -133,14 +135,7 @@ namespace detail
|
|||
} \
|
||||
}; \
|
||||
} \
|
||||
template<> \
|
||||
struct constraint< detail::N > \
|
||||
{ \
|
||||
constraint() \
|
||||
{} \
|
||||
detail::N c_; \
|
||||
}; \
|
||||
const constraint< detail::N > N;
|
||||
const mock::constraint< detail::N > N;
|
||||
|
||||
#define MOCK_BINARY_CONSTRAINT(N,Expr) \
|
||||
namespace detail \
|
||||
|
|
@ -170,7 +165,7 @@ namespace detail
|
|||
}; \
|
||||
} \
|
||||
template< typename T > \
|
||||
constraint< detail::N< T > > N( T t ) \
|
||||
mock::constraint< detail::N< T > > N( T t ) \
|
||||
{ \
|
||||
return detail::N< T >( t ); \
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue