-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A list of lists issue #215
Comments
Hi, Here is a working example: struct List1 {
using type = brigand::list<int, float>;
};
struct List2 {
using type = brigand::list<bool, char>;
};
struct List3 {
using type = brigand::list<long, double>;
};
using MyLists = brigand::list<List1, List3, List2>;
static_assert(brigand::index_of<MyLists, List1>() == 0, "wrong list index");
static_assert(brigand::index_of<MyLists, List2>() == 2, "wrong list index"); Hope this helps. If you haven't I'd suggest going over the Boost.MPL tutorial and looking at the reference there. Generally it seems what's in MPL can be used in Brigand as well, just change the namespace. |
It seems to look like a bug, algorithms work on lists, not subtypes.
|
yes this is the cost of an unambiguous lambda syntax, since we no longer test if something is a type or a metafunction everything runs faster but as a drawback we need to |
It sounds like maybe the best solution is to provide this exact situation in the documentation with the |
Thanks everyone :) Both approaches work fine. |
What would the example for the documentation look like? Also, what does Marcellus Wallace look like? |
@porkybrain however, template <class Sequence, class T>
using index_of = index_if<Sequence, std::is_same<pin<T>, _1>>; |
By the way, the problem is in |
Is this also the reason why the introductory example doesn't work for me?
|
sorry for being swamped in work right now ;)
Hope this brings clarity. |
Thanks. Think I got it. But I guess my issue above is something else then? Edit: Sorry for being way off topic. Did the implementation of brigand::found change?
|
Hi,
I'm new to metaprogramming and I've just started with brigand. I was playing with the library and faced with a problem. I can't compile the following code:
I get an error:
Can you help me with this?
The text was updated successfully, but these errors were encountered: