2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-21 17:02:36 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
nobody
f31a02bbf4 This commit was manufactured by cvs2svn to create tag
'Version_1_28_0'.

[SVN r13949]
2002-05-16 13:26:18 +00:00
Jaakko Järvi
4bdba37066 adding dummy usages of some arugments to avoid unused argument warnings
[SVN r13923]
2002-05-15 17:16:52 +00:00
nobody
aa3bf071a8 This commit was manufactured by cvs2svn to create branch 'RC_1_28_0'.
[SVN r13795]
2002-05-10 04:34:27 +00:00
5 changed files with 28 additions and 7 deletions

0
dummy
View File

View File

@@ -44,7 +44,7 @@ public:
struct sig { typedef element_t type; };
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const { return elem; }
RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; }
};
template <class T>
@@ -293,6 +293,7 @@ public:
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const
{
CALL_USE_ARGS;
return boost::tuples::get<0>(args);
}
@@ -311,7 +312,9 @@ class lambda_functor_base<do_nothing_action, Args> {
public:
explicit lambda_functor_base(const Args& a) {}
template<class RET, CALL_TEMPLATE_ARGS> RET call(CALL_FORMAL_ARGS) const {}
template<class RET, CALL_TEMPLATE_ARGS> RET call(CALL_FORMAL_ARGS) const {
CALL_USE_ARGS;
}
template<class SigArgs> struct sig { typedef void type; };
};
@@ -345,6 +348,7 @@ public:
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const {
CALL_USE_ARGS;
return Act::template apply<RET>();
}
};

View File

@@ -63,6 +63,7 @@ template<> struct placeholder<FIRST> {
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const {
BOOST_STATIC_ASSERT(boost::is_reference<RET>::value);
CALL_USE_ARGS; // does nothing, prevents warnings for unused args
return a;
}
};
@@ -74,7 +75,7 @@ template<> struct placeholder<SECOND> {
};
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const { return b; }
RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return b; }
};
template<> struct placeholder<THIRD> {
@@ -84,7 +85,7 @@ template<> struct placeholder<THIRD> {
};
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const { return c; }
RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return c; }
};
template<> struct placeholder<EXCEPTION> {
@@ -94,7 +95,7 @@ template<> struct placeholder<EXCEPTION> {
};
template<class RET, CALL_TEMPLATE_ARGS>
RET call(CALL_FORMAL_ARGS) const { return env; }
RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return env; }
};
typedef const lambda_functor<placeholder<FIRST> > placeholder1_type;

View File

@@ -59,5 +59,21 @@ class lambda_functor_base;
#define CALL_REFERENCE_TYPES A&, B&, C&, Env&
#define CALL_PLAIN_TYPES A, B, C, Env
namespace boost {
namespace lambda {
namespace detail {
template<class A1, class A2, class A3, class A4>
void do_nothing(A1&, A2&, A3&, A4&) {}
} // detail
} // lambda
} // boost
// prevent the warnings from unused argumetns
#define CALL_USE_ARGS \
::boost::lambda::detail::do_nothing(a, b, c, env)
#endif

View File

@@ -24,7 +24,7 @@ namespace detail {
// select functions -------------------------------
template<class Any, CALL_TEMPLATE_ARGS>
inline Any& select(Any& any, CALL_FORMAL_ARGS) { return any; }
inline Any& select(Any& any, CALL_FORMAL_ARGS) { CALL_USE_ARGS; return any; }
template<class Arg, CALL_TEMPLATE_ARGS>
@@ -57,7 +57,7 @@ template<class RET> struct r_select {
// Any == RET
template<class Any, CALL_TEMPLATE_ARGS>
static
inline RET go (Any& any, CALL_FORMAL_ARGS) { return any; }
inline RET go (Any& any, CALL_FORMAL_ARGS) { CALL_USE_ARGS; return any; }
template<class Arg, CALL_TEMPLATE_ARGS>