Fixed dependent names
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@91 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
621b2addce
commit
cb529b708c
4 changed files with 40 additions and 38 deletions
|
@ -168,7 +168,7 @@ namespace Loki
|
|||
bool found(true);
|
||||
iterator i(lower_bound(val.first));
|
||||
|
||||
if (i == end() || operator()(val.first, i->first))
|
||||
if (i == end() || this->operator()(val.first, i->first))
|
||||
{
|
||||
i = Base::insert(i, val);
|
||||
found = false;
|
||||
|
@ -178,10 +178,10 @@ namespace Loki
|
|||
|
||||
iterator insert(iterator pos, const value_type& val)
|
||||
{
|
||||
if (pos != end() && operator()(*pos, val) &&
|
||||
if (pos != end() && this->operator()(*pos, val) &&
|
||||
(pos == end() - 1 ||
|
||||
!operator()(val, pos[1]) &&
|
||||
operator()(pos[1], val)))
|
||||
!this->operator()(val, pos[1]) &&
|
||||
this->operator()(pos[1], val)))
|
||||
{
|
||||
return Base::insert(pos, val);
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ namespace Loki
|
|||
iterator find(const key_type& k)
|
||||
{
|
||||
iterator i(lower_bound(k));
|
||||
if (i != end() && operator()(k, i->first))
|
||||
if (i != end() && this->operator()(k, i->first))
|
||||
{
|
||||
i = end();
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ namespace Loki
|
|||
const_iterator find(const key_type& k) const
|
||||
{
|
||||
const_iterator i(lower_bound(k));
|
||||
if (i != end() && operator()(k, i->first))
|
||||
if (i != end() && this->operator()(k, i->first))
|
||||
{
|
||||
i = end();
|
||||
}
|
||||
|
@ -324,12 +324,13 @@ namespace Loki
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Change log:
|
||||
// May 20, 2001: change operator= - credit due to Cristoph Koegl
|
||||
// June 11, 2001: remove paren in equal_range - credit due to Cristoph Koegl
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// May 20, 2001: change operator= - credit due to Cristoph Koegl
|
||||
// June 11, 2001: remove paren in equal_range - credit due to Cristoph Koegl
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// January 22, 2002: fixed operator= - credit due to Tom Hyer
|
||||
// June 25, 2002: fixed template insert() - credit due to Robert Minsk
|
||||
// June 27, 2002: fixed member swap() - credit due to David Brookman
|
||||
// June 25, 2002: fixed template insert() - credit due to Robert Minsk
|
||||
// June 27, 2002: fixed member swap() - credit due to David Brookman
|
||||
// February 2, 2003: fixed dependent names - credit due to Rani Sharoni
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // ASSOCVECTOR_INC_
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
// without express or implied warranty.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Last update: June 20, 2001
|
||||
|
||||
#ifndef FACTORY_INC_
|
||||
#define FACTORY_INC_
|
||||
|
||||
|
@ -64,7 +62,7 @@ namespace Loki
|
|||
bool Register(const IdentifierType& id, ProductCreator creator)
|
||||
{
|
||||
return associations_.insert(
|
||||
typename IdToProductMap::value_type(id, creator)).second;
|
||||
IdToProductMap::value_type(id, creator)).second;
|
||||
}
|
||||
|
||||
bool Unregister(const IdentifierType& id)
|
||||
|
@ -79,7 +77,7 @@ namespace Loki
|
|||
{
|
||||
return (i->second)();
|
||||
}
|
||||
return OnUnknownType(id);
|
||||
return this->OnUnknownType(id);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -107,7 +105,7 @@ namespace Loki
|
|||
bool Register(const TypeInfo& ti, ProductCreator creator)
|
||||
{
|
||||
return associations_.insert(
|
||||
typename IdToProductMap::value_type(ti, creator)).second;
|
||||
IdToProductMap::value_type(ti, creator)).second;
|
||||
}
|
||||
|
||||
bool Unregister(const TypeInfo& id)
|
||||
|
@ -125,7 +123,7 @@ namespace Loki
|
|||
{
|
||||
return (i->second)(model);
|
||||
}
|
||||
return OnUnknownType(typeid(*model));
|
||||
return this->OnUnknownType(typeid(*model));
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -136,10 +134,11 @@ namespace Loki
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Change log:
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// May 08, 2002: replaced const_iterator with iterator so that self-modifying
|
||||
// ProductCreators are supported. Also, added a throw() spec to what().
|
||||
// Credit due to Jason Fischl.
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// May 08, 2002: replaced const_iterator with iterator so that self-modifying
|
||||
// ProductCreators are supported. Also, added a throw()
|
||||
// spec to what(). Credit due to Jason Fischl.
|
||||
// February 2, 2003: fixed dependent names - credit due to Rani Sharoni
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // FACTORY_INC_
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
// without express or implied warranty.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Last update: June 20, 2001
|
||||
|
||||
#ifndef MULTIMETHODS_INC_
|
||||
#define MULTIMETHODS_INC_
|
||||
|
||||
|
@ -267,7 +265,7 @@ namespace Loki
|
|||
template <class SomeLhs, class SomeRhs>
|
||||
void Add(ResultType (*pFun)(BaseLhs&, BaseRhs&))
|
||||
{
|
||||
return backEnd_.Add<SomeLhs, SomeRhs>(pFun);
|
||||
return backEnd_.template Add<SomeLhs, SomeRhs>(pFun);
|
||||
}
|
||||
|
||||
template <class SomeLhs, class SomeRhs,
|
||||
|
@ -308,7 +306,7 @@ namespace Loki
|
|||
template <class SomeLhs, class SomeRhs>
|
||||
void Remove()
|
||||
{
|
||||
backEnd_.Remove<SomeLhs, SomeRhs>();
|
||||
backEnd_.template Remove<SomeLhs, SomeRhs>();
|
||||
}
|
||||
|
||||
ResultType Go(BaseLhs& lhs, BaseRhs& rhs)
|
||||
|
@ -380,7 +378,7 @@ namespace Loki
|
|||
CastingPolicy<SomeRhs, BaseRhs>,
|
||||
Fun, false> Adapter;
|
||||
|
||||
backEnd_.Add<SomeLhs, SomeRhs>(FunctorType(Adapter(fun)));
|
||||
backEnd_.template Add<SomeLhs, SomeRhs>(FunctorType(Adapter(fun)));
|
||||
}
|
||||
template <class SomeLhs, class SomeRhs, bool symmetric, class Fun>
|
||||
void Add(const Fun& fun)
|
||||
|
@ -398,14 +396,14 @@ namespace Loki
|
|||
CastingPolicy<SomeRhs, BaseLhs>,
|
||||
Fun, true> AdapterR;
|
||||
|
||||
backEnd_.Add<SomeRhs, SomeLhs>(FunctorType(AdapterR(fun)));
|
||||
backEnd_.template Add<SomeRhs, SomeLhs>(FunctorType(AdapterR(fun)));
|
||||
}
|
||||
}
|
||||
|
||||
template <class SomeLhs, class SomeRhs>
|
||||
void Remove()
|
||||
{
|
||||
backEnd_.Remove<SomeLhs, SomeRhs>();
|
||||
backEnd_.template Remove<SomeLhs, SomeRhs>();
|
||||
}
|
||||
|
||||
ResultType Go(BaseLhs& lhs, BaseRhs& rhs)
|
||||
|
@ -417,7 +415,8 @@ namespace Loki
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Change log:
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// February 2, 2003: fixed dependent names - credit due to Rani Sharoni
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
// without express or implied warranty.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Last update: June 20, 2001
|
||||
|
||||
#ifndef SMARTPTR_INC_
|
||||
#define SMARTPTR_INC_
|
||||
|
||||
|
@ -45,12 +43,11 @@ namespace Loki
|
|||
template <class T>
|
||||
class DefaultSPStorage
|
||||
{
|
||||
protected:
|
||||
public:
|
||||
typedef T* StoredType; // the type of the pointee_ object
|
||||
typedef T* PointerType; // type returned by operator->
|
||||
typedef T& ReferenceType; // type returned by operator*
|
||||
|
||||
public:
|
||||
|
||||
DefaultSPStorage() : pointee_(Default())
|
||||
{}
|
||||
|
||||
|
@ -410,7 +407,10 @@ namespace Loki
|
|||
|
||||
static P Clone(const P&)
|
||||
{
|
||||
STATIC_CHECK(false, This_Policy_Disallows_Value_Copying);
|
||||
// Make it depended on template parameter
|
||||
static const bool DependedFalse = sizeof(P*) == 0;
|
||||
|
||||
STATIC_CHECK(DependedFalse, This_Policy_Disallows_Value_Copying);
|
||||
}
|
||||
|
||||
static bool Release(const P&)
|
||||
|
@ -601,8 +601,10 @@ namespace Loki
|
|||
|
||||
static void OnDefault(const P&)
|
||||
{
|
||||
STATIC_CHECK(false,
|
||||
This_Policy_Does_Not_Allow_Default_Initialization);
|
||||
// Make it depended on template parameter
|
||||
static const bool DependedFalse = sizeof(P*) == 0;
|
||||
|
||||
STATIC_CHECK(DependedFalse, ERROR_This_Policy_Does_Not_Allow_Default_Initialization);
|
||||
}
|
||||
|
||||
static void OnInit(const P& val)
|
||||
|
@ -1188,8 +1190,9 @@ namespace std
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Change log:
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// December 09, 2001: Included <cassert>
|
||||
// February 2, 2003: fixed dependent names - credit due to Rani Sharoni
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // SMARTPTR_INC_
|
||||
|
|
Loading…
Add table
Reference in a new issue