workaround for error C2182: '__formal' illegal use of type 'void'

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@114 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
humesikkins 2003-03-05 23:40:08 +00:00
parent 658f65d3d3
commit b87a77764d

View file

@ -1,4 +1,5 @@
// Last update: Dec 03, 2002
// Last update: Mar 06, 2003
// Added VoidWrap
// Added qualification ::Loki::Private:: to types from the Private-Namespace
// Thanks to Adi Shavit
@ -7,6 +8,7 @@
#if !defined (_MSC_VER) || _MSC_VER >= 1300
#error "please use this header only with MSVC 6.0"
#endif
#include "TypeManip.h"
namespace Loki
{
namespace Private
@ -30,6 +32,15 @@ namespace Loki
// Functor.h uses this Type as a workaround.
struct VoidAsType {};
// workaround for error C2182: '__formal' illegal use of type 'void'
// when trying to use void as default value of a template parameter.
// Instead of template<class T = void> class bla {};
// simply write template <class T = VoidWrap::type> class bla {};
// and the VC 6.0 will be happy.
struct VoidWrap
{
typedef void type;
};
// workarounds for template template parameters
////////////////////////////////////////////////////////////////////////////////
// class template AlwaysFalse