From 4faf23b2b12269779adc41bf695720ce5befce9c Mon Sep 17 00:00:00 2001 From: mat007 Date: Sun, 12 May 2013 08:58:49 +0000 Subject: [PATCH] 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 --- turtle/constraint.hpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/turtle/constraint.hpp b/turtle/constraint.hpp index 3c62576..fd45bb4 100644 --- a/turtle/constraint.hpp +++ b/turtle/constraint.hpp @@ -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 ); \ }