Answer the question
In order to leave comments, you need to log in
How to swap elements in mpl::vector so that derived classes are before their base ones?
I have a sequence of types. Check that they are all classes and arrange them so that the derived classes come before their base ones. For the resulting sequence, check that all classes are derived from the last one.
It is necessary to implement the solution using Boost::MPL
, let's say we have a list of types:
class base1 {};
class child1 : base1 {};
class child2 : child1 {};
class child3 : child2 {};
typedef vector<child2, child1, base1, child3> vec;
Answer the question
In order to leave comments, you need to log in
If child 2 is after child 1 then:
If child 2 is above child 1 then:.parent().find('селектор')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question