no message

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@66 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
magmaikh 2002-10-12 05:49:10 +00:00
parent 3584c9778a
commit 34baf93ed8
3 changed files with 21 additions and 20 deletions

View file

@ -19,7 +19,7 @@ namespace Loki
namespace TL namespace TL
{ {
template<typename T> template<typename T>
struct name_from_type struct nameof_type
{ {
const char* operator()() const char* operator()()
{ {
@ -92,14 +92,14 @@ namespace Loki
{ {
typedef GenFunc<AtomicType> genfunc_t; typedef GenFunc<AtomicType> genfunc_t;
template<class II> template<class II>
void operator()(II& ii) void operator()(II ii)
{ {
genfunc_t gen; genfunc_t gen;
*ii = gen(); *ii = gen();
++ii; ++ii;
} }
template<class II, class P1> template<class II, class P1>
void operator()(II& ii, P1 p1) void operator()(II ii, P1 p1)
{ {
genfunc_t gen; genfunc_t gen;
*ii = gen(p1); *ii = gen(p1);
@ -117,8 +117,8 @@ namespace Loki
{ {
struct Result struct Result
{ {
template<class II> void operator()(II&) {} template<class II> void operator()(II) {}
template<class II, class P1> void operator()(II&, P1) {} template<class II, class P1> void operator()(II, P1) {}
}; };
}; };
}; };
@ -132,8 +132,8 @@ namespace Loki
{ {
struct Result struct Result
{ {
template<class II> void operator()(II&) {} template<class II> void operator()(II) {}
template<class II, class P1> void operator()(II&, P1) {} template<class II, class P1> void operator()(II, P1) {}
}; };
}; };
}; };
@ -146,8 +146,8 @@ namespace Loki
{ {
struct Result struct Result
{ {
template<class II> void operator()(II&) {} template<class II> void operator()(II) {}
template<class II, class P1> void operator()(II&, P1) {} template<class II, class P1> void operator()(II, P1) {}
}; };
}; };
}; };
@ -185,13 +185,13 @@ namespace Loki
tail_t tail; tail_t tail;
template<class II> template<class II>
void operator()(II& ii) void operator()(II ii)
{ {
this->head.operator()(ii); this->head.operator()(ii);
this->tail.operator()(ii); this->tail.operator()(ii);
} }
template<class II, class P1> template<class II, class P1>
void operator()(II& ii, P1 p1) void operator()(II ii, P1 p1)
{ {
this->head.operator()(ii, p1); this->head.operator()(ii, p1);
this->tail.operator()(ii, p1); this->tail.operator()(ii, p1);
@ -203,7 +203,7 @@ namespace Loki
// with the 'undecorated' template parameter declaraion! // with the 'undecorated' template parameter declaraion!
//template <typename> class UnitFunc //template <typename> class UnitFunc
template<typename Types, class UnitFunc, typename II> template<typename Types, class UnitFunc, typename II>
void iterate_types(II &ii) void iterate_types(II ii)
{ {
Loki::TL::IterateTypes<Types, UnitFunc> it; Loki::TL::IterateTypes<Types, UnitFunc> it;
it(ii); it(ii);
@ -214,6 +214,6 @@ namespace Loki
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Change log: // Change log:
// Aug 17, 2002: Ported to MSVC7 by Rani Sharoni // Aug 17, 2002: Ported to MSVC7 by Rani Sharoni
// Aug 18, 2002: Removed ctor(ii&), replaced with operator(ii&) Shannon Barber // Aug 18, 2002: Removed ctor(II), replaced with operator(II) Shannon Barber
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View file

@ -193,7 +193,7 @@ namespace Loki
public: public:
// //
// VC7 BUG - will not detect refernce to function // VC7 BUG - will not detect reference to function
// //
enum { enum {
isReference = isReference =

View file

@ -40,7 +40,7 @@ namespace Loki
namespace TL namespace TL
{ {
template<typename T> template<typename T>
struct name_from_type struct nameof_type
{ {
const char* operator()() const char* operator()()
{ {
@ -66,7 +66,7 @@ namespace Loki
typedef IterateTypes<T2, GenFunc> tail_t; typedef IterateTypes<T2, GenFunc> tail_t;
tail_t tail; tail_t tail;
template<class II> template<class II>
void operator()(II& ii) void operator()(II ii)
{ {
head.operator()(ii); head.operator()(ii);
tail.operator()(ii); tail.operator()(ii);
@ -77,11 +77,11 @@ namespace Loki
struct IterateTypes struct IterateTypes
{ {
template<class II> template<class II>
void operator()(II& ii) void operator()(II ii)
{ {
GenFunc<AtomicType> genfunc; GenFunc<AtomicType> genfunc;
*ii = genfunc(); *ii = genfunc();
++ii; ++ii; //Is this even needed?
} }
}; };
@ -89,12 +89,12 @@ namespace Loki
struct IterateTypes<NullType, GenFunc> struct IterateTypes<NullType, GenFunc>
{ {
template<class II> template<class II>
void operator()(II& ii) void operator()(II ii)
{} {}
}; };
template<typename Types, template <typename> class UnitFunc, typename II> template<typename Types, template <typename> class UnitFunc, typename II>
void iterate_types(II &ii) void iterate_types(II ii)
{ {
Loki::TL::IterateTypes<Types, UnitFunc> it; Loki::TL::IterateTypes<Types, UnitFunc> it;
it(ii); it(ii);
@ -105,4 +105,5 @@ namespace Loki
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Change log: // Change log:
// 9/20/02 Named changed from GenData to IterateTypes // 9/20/02 Named changed from GenData to IterateTypes
// 10/8/02 insertion iterators are passed-by-value, not by-reference (oops)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////