Boost logo

Boost Users :

Subject: [Boost-users] accumulator taking a deduced argument - endless compilation time
From: er (erwann.rogard_at_[hidden])
Date: 2009-02-22 00:54:49


Hello,

Comments are in the code. Any help appreciated.

*.hpp

     template<typename RealType,typename Id>
     class mu
       : public accumulator_base
     {
         typedef mu<RealType,Id> self_type;
         typedef parameter::deduced<self_type> par0_type;
         typedef parameter::parameters<par0_type> params;
         public:
         typedef RealType result_type;
         mu(result_type value):value_(value){}

         template<typename Args>
         mu(const Args& args):value_((result_type)(0)){
        // compile bottleneck (caused by the assigment, not the rhs)
             const self_type& input = params()(args);
             value_ = input.value_;
         }
         private:
         result_type value_;
     };

*cpp:

     typedef mpl::int_<0> id0_t;
     typedef accumulators::tag::mu<id0_t> mu0_t;
     typedef boost::mpl::vector<
         mu0_t
> explicit_entities;

     typedef double value_type;
     typedef accumulators::accumulator_set<
         value_type,
         explicit_entities
> acc_type;

     typedef mpl::apply<mu0_t::impl,value_type>::type input0_type;

     input0_type input0(0.5);
     // acc_type acc; // compiles fast
     acc_type acc((input0)); // compiles forever


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net