Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / accumulators / framework / depends_on.hpp @ 2486

History | View | Annotate | Download (14.5 kB)

1 2486 sjacqu01
///////////////////////////////////////////////////////////////////////////////
2 2486 sjacqu01
// depends_on.hpp
3 2486 sjacqu01
//
4 2486 sjacqu01
//  Copyright 2005 Eric Niebler. Distributed under the Boost
5 2486 sjacqu01
//  Software License, Version 1.0. (See accompanying file
6 2486 sjacqu01
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 2486 sjacqu01
8 2486 sjacqu01
#ifndef BOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005
9 2486 sjacqu01
#define BOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005
10 2486 sjacqu01
11 2486 sjacqu01
#include <boost/version.hpp>
12 2486 sjacqu01
#include <boost/mpl/end.hpp>
13 2486 sjacqu01
#include <boost/mpl/map.hpp>
14 2486 sjacqu01
#include <boost/mpl/set.hpp>
15 2486 sjacqu01
#include <boost/mpl/copy.hpp>
16 2486 sjacqu01
#include <boost/mpl/fold.hpp>
17 2486 sjacqu01
#include <boost/mpl/size.hpp>
18 2486 sjacqu01
#include <boost/mpl/sort.hpp>
19 2486 sjacqu01
#include <boost/mpl/insert.hpp>
20 2486 sjacqu01
#include <boost/mpl/assert.hpp>
21 2486 sjacqu01
#include <boost/mpl/remove.hpp>
22 2486 sjacqu01
#include <boost/mpl/vector.hpp>
23 2486 sjacqu01
#include <boost/mpl/inherit.hpp>
24 2486 sjacqu01
#include <boost/mpl/identity.hpp>
25 2486 sjacqu01
#include <boost/mpl/equal_to.hpp>
26 2486 sjacqu01
#include <boost/mpl/contains.hpp>
27 2486 sjacqu01
#include <boost/mpl/transform.hpp>
28 2486 sjacqu01
#include <boost/mpl/is_sequence.hpp>
29 2486 sjacqu01
#include <boost/mpl/placeholders.hpp>
30 2486 sjacqu01
#include <boost/mpl/insert_range.hpp>
31 2486 sjacqu01
#include <boost/mpl/back_inserter.hpp>
32 2486 sjacqu01
#include <boost/mpl/transform_view.hpp>
33 2486 sjacqu01
#include <boost/mpl/inherit_linearly.hpp>
34 2486 sjacqu01
#include <boost/type_traits/is_base_and_derived.hpp>
35 2486 sjacqu01
#include <boost/preprocessor/repetition/repeat.hpp>
36 2486 sjacqu01
#include <boost/preprocessor/repetition/enum_params.hpp>
37 2486 sjacqu01
#include <boost/preprocessor/facilities/intercept.hpp>
38 2486 sjacqu01
#include <boost/accumulators/accumulators_fwd.hpp>
39 2486 sjacqu01
#include <boost/fusion/include/next.hpp>
40 2486 sjacqu01
#include <boost/fusion/include/equal_to.hpp>
41 2486 sjacqu01
#include <boost/fusion/include/value_of.hpp>
42 2486 sjacqu01
#include <boost/fusion/include/mpl.hpp>
43 2486 sjacqu01
#include <boost/fusion/include/end.hpp>
44 2486 sjacqu01
#include <boost/fusion/include/begin.hpp>
45 2486 sjacqu01
#include <boost/fusion/include/cons.hpp>
46 2486 sjacqu01
47 2486 sjacqu01
namespace boost { namespace accumulators
48 2486 sjacqu01
{
49 2486 sjacqu01
    ///////////////////////////////////////////////////////////////////////////
50 2486 sjacqu01
    // as_feature
51 2486 sjacqu01
    template<typename Feature>
52 2486 sjacqu01
    struct as_feature
53 2486 sjacqu01
    {
54 2486 sjacqu01
        typedef Feature type;
55 2486 sjacqu01
    };
56 2486 sjacqu01
57 2486 sjacqu01
    ///////////////////////////////////////////////////////////////////////////
58 2486 sjacqu01
    // weighted_feature
59 2486 sjacqu01
    template<typename Feature>
60 2486 sjacqu01
    struct as_weighted_feature
61 2486 sjacqu01
    {
62 2486 sjacqu01
        typedef Feature type;
63 2486 sjacqu01
    };
64 2486 sjacqu01
65 2486 sjacqu01
    ///////////////////////////////////////////////////////////////////////////
66 2486 sjacqu01
    // feature_of
67 2486 sjacqu01
    template<typename Feature>
68 2486 sjacqu01
    struct feature_of
69 2486 sjacqu01
    {
70 2486 sjacqu01
        typedef Feature type;
71 2486 sjacqu01
    };
72 2486 sjacqu01
73 2486 sjacqu01
    namespace detail
74 2486 sjacqu01
    {
75 2486 sjacqu01
        ///////////////////////////////////////////////////////////////////////////
76 2486 sjacqu01
        // feature_tag
77 2486 sjacqu01
        template<typename Accumulator>
78 2486 sjacqu01
        struct feature_tag
79 2486 sjacqu01
        {
80 2486 sjacqu01
            typedef typename Accumulator::feature_tag type;
81 2486 sjacqu01
        };
82 2486 sjacqu01
83 2486 sjacqu01
        template<typename Feature>
84 2486 sjacqu01
        struct undroppable
85 2486 sjacqu01
        {
86 2486 sjacqu01
            typedef Feature type;
87 2486 sjacqu01
        };
88 2486 sjacqu01
89 2486 sjacqu01
        template<typename Feature>
90 2486 sjacqu01
        struct undroppable<tag::droppable<Feature> >
91 2486 sjacqu01
        {
92 2486 sjacqu01
            typedef Feature type;
93 2486 sjacqu01
        };
94 2486 sjacqu01
95 2486 sjacqu01
        // For the purpose of determining whether one feature depends on another,
96 2486 sjacqu01
        // disregard whether the feature is droppable or not.
97 2486 sjacqu01
        template<typename A, typename B>
98 2486 sjacqu01
        struct is_dependent_on
99 2486 sjacqu01
          : is_base_and_derived<
100 2486 sjacqu01
                typename feature_of<typename undroppable<B>::type>::type
101 2486 sjacqu01
              , typename undroppable<A>::type
102 2486 sjacqu01
            >
103 2486 sjacqu01
        {};
104 2486 sjacqu01
105 2486 sjacqu01
        template<typename Feature>
106 2486 sjacqu01
        struct dependencies_of
107 2486 sjacqu01
        {
108 2486 sjacqu01
            typedef typename Feature::dependencies type;
109 2486 sjacqu01
        };
110 2486 sjacqu01
111 2486 sjacqu01
        // Should use mpl::insert_range, but doesn't seem to work with mpl sets
112 2486 sjacqu01
        template<typename Set, typename Range>
113 2486 sjacqu01
        struct set_insert_range
114 2486 sjacqu01
          : mpl::fold<
115 2486 sjacqu01
                Range
116 2486 sjacqu01
              , Set
117 2486 sjacqu01
              , mpl::insert<mpl::_1, mpl::_2>
118 2486 sjacqu01
            >
119 2486 sjacqu01
        {};
120 2486 sjacqu01
121 2486 sjacqu01
        template<typename Features>
122 2486 sjacqu01
        struct collect_abstract_features
123 2486 sjacqu01
          : mpl::fold<
124 2486 sjacqu01
                Features
125 2486 sjacqu01
              , mpl::set0<>
126 2486 sjacqu01
              , set_insert_range<
127 2486 sjacqu01
                    mpl::insert<mpl::_1, feature_of<mpl::_2> >
128 2486 sjacqu01
                  , collect_abstract_features<dependencies_of<mpl::_2> >
129 2486 sjacqu01
                >
130 2486 sjacqu01
            >
131 2486 sjacqu01
        {};
132 2486 sjacqu01
133 2486 sjacqu01
        template<typename Features>
134 2486 sjacqu01
        struct depends_on_base
135 2486 sjacqu01
          : mpl::inherit_linearly<
136 2486 sjacqu01
                typename mpl::sort<
137 2486 sjacqu01
                    typename mpl::copy<
138 2486 sjacqu01
                        typename collect_abstract_features<Features>::type
139 2486 sjacqu01
                      , mpl::back_inserter<mpl::vector0<> >
140 2486 sjacqu01
                    >::type
141 2486 sjacqu01
                  , is_dependent_on<mpl::_1, mpl::_2>
142 2486 sjacqu01
                >::type
143 2486 sjacqu01
                // Don't inherit multiply from a feature
144 2486 sjacqu01
              , mpl::if_<
145 2486 sjacqu01
                    is_dependent_on<mpl::_1, mpl::_2>
146 2486 sjacqu01
                  , mpl::_1
147 2486 sjacqu01
                  , mpl::inherit<mpl::_1, mpl::_2>
148 2486 sjacqu01
                >
149 2486 sjacqu01
            >::type
150 2486 sjacqu01
        {
151 2486 sjacqu01
        };
152 2486 sjacqu01
    }
153 2486 sjacqu01
154 2486 sjacqu01
    ///////////////////////////////////////////////////////////////////////////
155 2486 sjacqu01
    /// depends_on
156 2486 sjacqu01
    template<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature)>
157 2486 sjacqu01
    struct depends_on
158 2486 sjacqu01
      : detail::depends_on_base<
159 2486 sjacqu01
            typename mpl::transform<
160 2486 sjacqu01
                mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
161 2486 sjacqu01
              , as_feature<mpl::_1>
162 2486 sjacqu01
            >::type
163 2486 sjacqu01
        >
164 2486 sjacqu01
    {
165 2486 sjacqu01
        typedef mpl::false_ is_weight_accumulator;
166 2486 sjacqu01
        typedef
167 2486 sjacqu01
            typename mpl::transform<
168 2486 sjacqu01
                mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
169 2486 sjacqu01
              , as_feature<mpl::_1>
170 2486 sjacqu01
            >::type
171 2486 sjacqu01
        dependencies;
172 2486 sjacqu01
    };
173 2486 sjacqu01
174 2486 sjacqu01
    namespace detail
175 2486 sjacqu01
    {
176 2486 sjacqu01
        template<typename Feature>
177 2486 sjacqu01
        struct matches_feature
178 2486 sjacqu01
        {
179 2486 sjacqu01
            template<typename Accumulator>
180 2486 sjacqu01
            struct apply
181 2486 sjacqu01
              : is_same<
182 2486 sjacqu01
                    typename feature_of<typename as_feature<Feature>::type>::type
183 2486 sjacqu01
                  , typename feature_of<typename as_feature<typename feature_tag<Accumulator>::type>::type>::type
184 2486 sjacqu01
                >
185 2486 sjacqu01
            {};
186 2486 sjacqu01
        };
187 2486 sjacqu01
188 2486 sjacqu01
        template<typename Features, typename Accumulator>
189 2486 sjacqu01
        struct contains_feature_of
190 2486 sjacqu01
        {
191 2486 sjacqu01
            typedef
192 2486 sjacqu01
                mpl::transform_view<Features, feature_of<as_feature<mpl::_> > >
193 2486 sjacqu01
            features_list;
194 2486 sjacqu01
195 2486 sjacqu01
            typedef
196 2486 sjacqu01
                typename feature_of<typename feature_tag<Accumulator>::type>::type
197 2486 sjacqu01
            the_feature;
198 2486 sjacqu01
199 2486 sjacqu01
            typedef
200 2486 sjacqu01
                typename mpl::contains<features_list, the_feature>::type
201 2486 sjacqu01
            type;
202 2486 sjacqu01
        };
203 2486 sjacqu01
204 2486 sjacqu01
        // This is to work around a bug in early versions of Fusion which caused
205 2486 sjacqu01
        // a compile error if contains_feature_of<List, mpl::_> is used as a
206 2486 sjacqu01
        // predicate to fusion::find_if
207 2486 sjacqu01
        template<typename Features>
208 2486 sjacqu01
        struct contains_feature_of_
209 2486 sjacqu01
        {
210 2486 sjacqu01
            template<typename Accumulator>
211 2486 sjacqu01
            struct apply
212 2486 sjacqu01
              : contains_feature_of<Features, Accumulator>
213 2486 sjacqu01
            {};
214 2486 sjacqu01
        };
215 2486 sjacqu01
216 2486 sjacqu01
        template<
217 2486 sjacqu01
            typename First
218 2486 sjacqu01
          , typename Last
219 2486 sjacqu01
          , bool is_empty = fusion::result_of::equal_to<First, Last>::value
220 2486 sjacqu01
        >
221 2486 sjacqu01
        struct build_acc_list;
222 2486 sjacqu01
223 2486 sjacqu01
        template<typename First, typename Last>
224 2486 sjacqu01
        struct build_acc_list<First, Last, true>
225 2486 sjacqu01
        {
226 2486 sjacqu01
            typedef fusion::nil type;
227 2486 sjacqu01
228 2486 sjacqu01
            template<typename Args>
229 2486 sjacqu01
            static fusion::nil
230 2486 sjacqu01
            call(Args const &, First const&, Last const&)
231 2486 sjacqu01
            {
232 2486 sjacqu01
                return fusion::nil();
233 2486 sjacqu01
            }
234 2486 sjacqu01
        };
235 2486 sjacqu01
236 2486 sjacqu01
        template<typename First, typename Last>
237 2486 sjacqu01
        struct build_acc_list<First, Last, false>
238 2486 sjacqu01
        {
239 2486 sjacqu01
            typedef
240 2486 sjacqu01
                build_acc_list<typename fusion::result_of::next<First>::type, Last>
241 2486 sjacqu01
            next_build_acc_list;
242 2486 sjacqu01
243 2486 sjacqu01
            typedef fusion::cons<
244 2486 sjacqu01
                typename fusion::result_of::value_of<First>::type
245 2486 sjacqu01
              , typename next_build_acc_list::type>
246 2486 sjacqu01
            type;
247 2486 sjacqu01
248 2486 sjacqu01
            template<typename Args>
249 2486 sjacqu01
            static type
250 2486 sjacqu01
            call(Args const &args, First const& f, Last const& l)
251 2486 sjacqu01
            {
252 2486 sjacqu01
                return type(args, next_build_acc_list::call(args, fusion::next(f), l));
253 2486 sjacqu01
            }
254 2486 sjacqu01
        };
255 2486 sjacqu01
256 2486 sjacqu01
        namespace meta
257 2486 sjacqu01
        {
258 2486 sjacqu01
            template<typename Sequence>
259 2486 sjacqu01
            struct make_acc_list
260 2486 sjacqu01
              : build_acc_list<
261 2486 sjacqu01
                    typename fusion::result_of::begin<Sequence>::type
262 2486 sjacqu01
                  , typename fusion::result_of::end<Sequence>::type
263 2486 sjacqu01
                >
264 2486 sjacqu01
            {};
265 2486 sjacqu01
        }
266 2486 sjacqu01
267 2486 sjacqu01
        template<typename Sequence, typename Args>
268 2486 sjacqu01
        typename meta::make_acc_list<Sequence>::type
269 2486 sjacqu01
        make_acc_list(Sequence const &seq, Args const &args)
270 2486 sjacqu01
        {
271 2486 sjacqu01
            return meta::make_acc_list<Sequence>::call(args, fusion::begin(seq), fusion::end(seq));
272 2486 sjacqu01
        }
273 2486 sjacqu01
274 2486 sjacqu01
        ///////////////////////////////////////////////////////////////////////////
275 2486 sjacqu01
        // checked_as_weighted_feature
276 2486 sjacqu01
        template<typename Feature>
277 2486 sjacqu01
        struct checked_as_weighted_feature
278 2486 sjacqu01
        {
279 2486 sjacqu01
            typedef typename as_feature<Feature>::type feature_type;
280 2486 sjacqu01
            typedef typename as_weighted_feature<feature_type>::type type;
281 2486 sjacqu01
            // weighted and non-weighted flavors should provide the same feature.
282 2486 sjacqu01
            BOOST_MPL_ASSERT((
283 2486 sjacqu01
                is_same<
284 2486 sjacqu01
                    typename feature_of<feature_type>::type
285 2486 sjacqu01
                  , typename feature_of<type>::type
286 2486 sjacqu01
                >
287 2486 sjacqu01
            ));
288 2486 sjacqu01
        };
289 2486 sjacqu01
290 2486 sjacqu01
        ///////////////////////////////////////////////////////////////////////////
291 2486 sjacqu01
        // as_feature_list
292 2486 sjacqu01
        template<typename Features, typename Weight>
293 2486 sjacqu01
        struct as_feature_list
294 2486 sjacqu01
          : mpl::transform_view<Features, checked_as_weighted_feature<mpl::_1> >
295 2486 sjacqu01
        {
296 2486 sjacqu01
        };
297 2486 sjacqu01
298 2486 sjacqu01
        template<typename Features>
299 2486 sjacqu01
        struct as_feature_list<Features, void>
300 2486 sjacqu01
          : mpl::transform_view<Features, as_feature<mpl::_1> >
301 2486 sjacqu01
        {
302 2486 sjacqu01
        };
303 2486 sjacqu01
304 2486 sjacqu01
        ///////////////////////////////////////////////////////////////////////////
305 2486 sjacqu01
        // accumulator_wrapper
306 2486 sjacqu01
        template<typename Accumulator, typename Feature>
307 2486 sjacqu01
        struct accumulator_wrapper
308 2486 sjacqu01
          : Accumulator
309 2486 sjacqu01
        {
310 2486 sjacqu01
            typedef Feature feature_tag;
311 2486 sjacqu01
312 2486 sjacqu01
            accumulator_wrapper(accumulator_wrapper const &that)
313 2486 sjacqu01
              : Accumulator(*static_cast<Accumulator const *>(&that))
314 2486 sjacqu01
            {
315 2486 sjacqu01
            }
316 2486 sjacqu01
317 2486 sjacqu01
            template<typename Args>
318 2486 sjacqu01
            accumulator_wrapper(Args const &args)
319 2486 sjacqu01
              : Accumulator(args)
320 2486 sjacqu01
            {
321 2486 sjacqu01
            }
322 2486 sjacqu01
        };
323 2486 sjacqu01
324 2486 sjacqu01
        ///////////////////////////////////////////////////////////////////////////
325 2486 sjacqu01
        // to_accumulator
326 2486 sjacqu01
        template<typename Feature, typename Sample, typename Weight>
327 2486 sjacqu01
        struct to_accumulator
328 2486 sjacqu01
        {
329 2486 sjacqu01
            typedef
330 2486 sjacqu01
                accumulator_wrapper<
331 2486 sjacqu01
                    typename mpl::apply2<typename Feature::impl, Sample, Weight>::type
332 2486 sjacqu01
                  , Feature
333 2486 sjacqu01
                >
334 2486 sjacqu01
            type;
335 2486 sjacqu01
        };
336 2486 sjacqu01
337 2486 sjacqu01
        template<typename Feature, typename Sample, typename Weight, typename Tag, typename AccumulatorSet>
338 2486 sjacqu01
        struct to_accumulator<Feature, Sample, tag::external<Weight, Tag, AccumulatorSet> >
339 2486 sjacqu01
        {
340 2486 sjacqu01
            BOOST_MPL_ASSERT((is_same<Tag, void>));
341 2486 sjacqu01
            BOOST_MPL_ASSERT((is_same<AccumulatorSet, void>));
342 2486 sjacqu01
343 2486 sjacqu01
            typedef
344 2486 sjacqu01
                accumulator_wrapper<
345 2486 sjacqu01
                    typename mpl::apply2<typename Feature::impl, Sample, Weight>::type
346 2486 sjacqu01
                  , Feature
347 2486 sjacqu01
                >
348 2486 sjacqu01
            accumulator_type;
349 2486 sjacqu01
350 2486 sjacqu01
            typedef
351 2486 sjacqu01
                typename mpl::if_<
352 2486 sjacqu01
                    typename Feature::is_weight_accumulator
353 2486 sjacqu01
                  , accumulator_wrapper<impl::external_impl<accumulator_type, tag::weights>, Feature>
354 2486 sjacqu01
                  , accumulator_type
355 2486 sjacqu01
                >::type
356 2486 sjacqu01
            type;
357 2486 sjacqu01
        };
358 2486 sjacqu01
359 2486 sjacqu01
        // BUGBUG work around an MPL bug wrt map insertion
360 2486 sjacqu01
        template<typename FeatureMap, typename Feature>
361 2486 sjacqu01
        struct insert_feature
362 2486 sjacqu01
          : mpl::eval_if<
363 2486 sjacqu01
                mpl::has_key<FeatureMap, typename feature_of<Feature>::type>
364 2486 sjacqu01
              , mpl::identity<FeatureMap>
365 2486 sjacqu01
              , mpl::insert<FeatureMap, mpl::pair<typename feature_of<Feature>::type, Feature> >
366 2486 sjacqu01
            >
367 2486 sjacqu01
        {
368 2486 sjacqu01
        };
369 2486 sjacqu01
370 2486 sjacqu01
        template<typename FeatureMap, typename Feature, typename Weight>
371 2486 sjacqu01
        struct insert_dependencies
372 2486 sjacqu01
          : mpl::fold<
373 2486 sjacqu01
                as_feature_list<typename Feature::dependencies, Weight>
374 2486 sjacqu01
              , FeatureMap
375 2486 sjacqu01
              , insert_dependencies<
376 2486 sjacqu01
                    insert_feature<mpl::_1, mpl::_2>
377 2486 sjacqu01
                  , mpl::_2
378 2486 sjacqu01
                  , Weight
379 2486 sjacqu01
                >
380 2486 sjacqu01
            >
381 2486 sjacqu01
        {
382 2486 sjacqu01
        };
383 2486 sjacqu01
384 2486 sjacqu01
        template<typename FeatureMap, typename Features, typename Weight>
385 2486 sjacqu01
        struct insert_sequence
386 2486 sjacqu01
          : mpl::fold< // BUGBUG should use insert_range, but doesn't seem to work for maps
387 2486 sjacqu01
                as_feature_list<Features, Weight>
388 2486 sjacqu01
              , FeatureMap
389 2486 sjacqu01
              , insert_feature<mpl::_1, mpl::_2>
390 2486 sjacqu01
            >
391 2486 sjacqu01
        {
392 2486 sjacqu01
        };
393 2486 sjacqu01
394 2486 sjacqu01
        template<typename Features, typename Sample, typename Weight>
395 2486 sjacqu01
        struct make_accumulator_tuple
396 2486 sjacqu01
        {
397 2486 sjacqu01
            typedef
398 2486 sjacqu01
                typename mpl::fold<
399 2486 sjacqu01
                    as_feature_list<Features, Weight>
400 2486 sjacqu01
                  , mpl::map0<>
401 2486 sjacqu01
                  , mpl::if_<
402 2486 sjacqu01
                        mpl::is_sequence<mpl::_2>
403 2486 sjacqu01
                      , insert_sequence<mpl::_1, mpl::_2, Weight>
404 2486 sjacqu01
                      , insert_feature<mpl::_1, mpl::_2>
405 2486 sjacqu01
                    >
406 2486 sjacqu01
                >::type
407 2486 sjacqu01
            feature_map;
408 2486 sjacqu01
409 2486 sjacqu01
            // for each element in the map, add its dependencies also
410 2486 sjacqu01
            typedef
411 2486 sjacqu01
                typename mpl::fold<
412 2486 sjacqu01
                    feature_map
413 2486 sjacqu01
                  , feature_map
414 2486 sjacqu01
                  , insert_dependencies<mpl::_1, mpl::second<mpl::_2>, Weight>
415 2486 sjacqu01
                >::type
416 2486 sjacqu01
            feature_map_with_dependencies;
417 2486 sjacqu01
418 2486 sjacqu01
            // turn the map into a vector so we can sort it
419 2486 sjacqu01
            typedef
420 2486 sjacqu01
                typename mpl::insert_range<
421 2486 sjacqu01
                    mpl::vector<>
422 2486 sjacqu01
                  , mpl::end<mpl::vector<> >::type
423 2486 sjacqu01
                  , mpl::transform_view<feature_map_with_dependencies, mpl::second<mpl::_1> >
424 2486 sjacqu01
                >::type
425 2486 sjacqu01
            feature_vector_with_dependencies;
426 2486 sjacqu01
427 2486 sjacqu01
            // sort the features according to which is derived from which
428 2486 sjacqu01
            typedef
429 2486 sjacqu01
                typename mpl::sort<
430 2486 sjacqu01
                    feature_vector_with_dependencies
431 2486 sjacqu01
                  , is_dependent_on<mpl::_2, mpl::_1>
432 2486 sjacqu01
                >::type
433 2486 sjacqu01
            sorted_feature_vector;
434 2486 sjacqu01
435 2486 sjacqu01
            // From the vector of features, construct a vector of accumulators
436 2486 sjacqu01
            typedef
437 2486 sjacqu01
                typename mpl::transform<
438 2486 sjacqu01
                    sorted_feature_vector
439 2486 sjacqu01
                  , to_accumulator<mpl::_1, Sample, Weight>
440 2486 sjacqu01
                >::type
441 2486 sjacqu01
            type;
442 2486 sjacqu01
        };
443 2486 sjacqu01
444 2486 sjacqu01
    } // namespace detail
445 2486 sjacqu01
446 2486 sjacqu01
}} // namespace boost::accumulators
447 2486 sjacqu01
448 2486 sjacqu01
#endif