mirror of
https://github.com/boostorg/lambda.git
synced 2026-01-21 17:02:36 +00:00
Compare commits
2 Commits
feature/is
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bdba37066 | ||
|
|
aa3bf071a8 |
@@ -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>();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user