"Noel Belcourt"
Hi,
I'm new to the list so this may have been answered elsewhere (like a FAQ for MPL) but I couldn't find it.
I've got 2 vector_c types like this
typedef vector_c
p1; typedef vector_c p2; and a resultant type defined as
typedef vector_c
r;
Resultant from what?
that I want to compare at compile time using logic like this
r = p1 || p1 && p2
That would be equivalent to r = p1. Why go to all that trouble? Or
do you mean
r == p1 || p1 && p2
??
Anyway, what does it mean to use the logical && operator on two
sequences? Do you want elementwise comparison? Do you want the same
for r == p1? The usual meaning is to compare all elements and produce
a scalar boolean, which would then be incompatible with the vector of
bools produced by p1 && p2. Maybe you mean something like;
mpl::transform<
mpl::transform
This pseudo code is what I want to do but I know this doesn't work. Can anyone can suggest a better approach?
template
struct validate_checkin : boost::mpl::equal< boost::mpl::placeholders::_1, boost::mpl::or_< boost::mpl::placeholders::_2, boost::mpl::and_< boost::mpl::placeholders::_2, boost::mpl::placeholders::_3 >, ,
{};
Ugh; do yourself a favor and apply a couple of namespace aliases at
least; the whole point of those placeholders is that they're supposed
to increase readability!
Simplifying:
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
template