MPL - creating new sequence from another sequence using predicate
Hi,
I have a mpl::vector of types. Each of the types in the vector have
themselves another nested mpl::vector that is a sequence of enums. I have
include the code below.
What I am trying to do is take the original sequence and make a new sequence
based on the predicate that only elements with certains enums in their
nested vector be included in the new sequence. I have included more notes
in the embedded comments.
I was thinking of using mpl::copy_if but am having trouble getting the
predicate right.
Wanted to know if anyone could steer me in the right direction. I am trying
to fill in the ??? below. I am having trouble writing a custom predicate.
Thanks in advance.
Regards,
Bruce
#include <string>
#include <iostream>
#include
colorcoll1;
typedef mpl::vector<
mpl::integral_c
colorcoll2;
typedef mpl::vector<
mpl::integral_c
colorcoll3;
typedef mpl::vector
"Bruce Trask"
1. ( ) text/plain (*) text/html
Hi,
I have a mpl::vector of types. Each of the types in the vector have themselves another nested mpl::vector that is a sequence of enums. I have include the code below.
What I am trying to do is take the original sequence and make a new sequence based on the predicate that only elements with certains enums in their nested vector be included in the new sequence. I have included more notes in the embedded comments.
I was thinking of using mpl::copy_if but am having trouble getting the predicate right.
Wanted to know if anyone could steer me in the right direction. I am trying to fill in the ??? below. I am having trouble writing a custom predicate.
Thanks in advance.
Regards,
Bruce
#include <string>
#include <iostream>
#include
Hints: #1 don't use tabs in your code samples; they get stripped by most mailers #2 fix your newlines #3 post your code as an attachment and it will always come through correctly. How does what I've done below look to you? -- Dave Abrahams Boost Consulting www.boost-consulting.com
On Thu, 2005-03-10 at 22:43 -0500, David Abrahams wrote: Hi David,
#1 don't use tabs in your code samples; they get stripped by most mailers #2 fix your newlines #3 post your code as an attachment and it will always come through correctly.
Right. Sorry 'bout that.
How does what I've done below look to you?
Looks great. Thanks. Very fascinating library David. Appreciate your help. Regards, Bruce
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Folks, I have recently come upon template meta programming. The powers of metaprogramming are very evident to me. However, I have been unable to find references to recent performance numbers for how various compilers compare with extensive use of templates. Compile-time and run-time comparisons would be of value. Specifically, my interest is for the following three compilers - Microsoft's VC++ - gcc - Intel's compiler. (The later the versions on these, the better). Any pointer's to answers or efforts that are aiming to accomplish the same would be much appreciated. thanks, -shishir
Shishir Ramam
Folks, I have recently come upon template meta programming. The powers of metaprogramming are very evident to me.
However, I have been unable to find references to recent performance numbers for how various compilers compare with extensive use of templates.
There's an extensive appendix with graphs and everything in http://www.boost-consulting.com/metaprogramming-book.html -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
Bruce Trask
-
David Abrahams
-
Shishir Ramam