home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,705 of 33,346   
   greg to Dave Abrahams   
   Re: boost.fusion vector question   
   05 Dec 12 10:11:44   
   
   From: gregory.newmann@googlemail.com   
      
   On Thursday, 22 November 2012 06:30:27 UTC+1, Dave Abrahams  wrote:   
   >   
   > Something like this (untested)?   
   >   
   > (...) cut   
      
      
   Hi Dave,   
      
   thanks for the answer. Bad luck I was concentrating on views, it is much   
   simpler with your approach.   
      
   In any case I still have problems with the code. My function object   
   looks like this:   
      
   template    
   struct tuple_at{   
      template   struct result;   
      
      template    
      struct result : fusion::result_of::at_c  {  };   
      
      template    
      typename result::type  operator()(Tuple const& t) const {   
        return const_cast::type>   
   (fusion::at_c(t));   
      }   
   };   
      
   [had to use the const_cast to move forward]   
      
   I did not make any modifications to the fun method. When I try to   
   compile I get a bunch of errors, with the last one pointing to something   
   wrong with the tuple_at object:   
      
      
   boost_1_52_0/boost/fusion/sequence/intrinsic/at.hpp:64: error: invalid   
   use of undefined type struct   
   boost::fusion::extension::at_impl::apply&, mpl_::int_<0> >   
      
   boost_1_52_0/boost/fusion/sequence/intrinsic/at.hpp:32: error:   
   declaration of struct   
   boost::fusion::extension::at_impl::apply&, mpl_::int_<0> >   
      
   boost_1_52_0/boost/mpl/eval_if.hpp:38: error: no type named type in   
   struct boost::result_of ()(const   
   boost::fusion::vector&)>   
      
   Any thoughts on these?   
      
   Is there any reliable book with some in-depth boost explanations? The   
   online documentation is not in the best shape :(   
      
   >   
   > How long did they give you for this one?   
   >   
      
   This was only one of few questions, other were not boost related and I   
   was supposed to send my solutions back the next day.   
      
   Thanks,   
   Greg   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca