Re: [Boost-users] [mpl] at_c type compiler error

------------------------------------------------------------ Subject: Boost-users Digest, Vol 1423, Issue 3 Date: Thu, 18 Oct 2007 12:00:06 -0400 Message-ID: <mailman.11.1192723206.19439.boost-users@lists.boost.org> ------------------------------------------------------------ Message: 3 Date: Thu, 18 Oct 2007 17:03:25 +0200 From: Vinzenz 'evilissimo' Feenstra <evilissimo@web.de> Subject: Re: [Boost-users] [mpl] at_c type compiler error To: boost-users@lists.boost.org Message-ID: <471775BD.3010403@web.de> ------------------------------------------------------------ Chris Weed schrieb:
Hi all -- Just to say I encountered what looks to be the same problem. Here is the note I left myself: // can later access the statistics as follows: // // std::tr1::tuple<int, double, double, double, double, double> stats; // stats = myTs.getStats(); // int count; // count = stats.get<0>(); // member function usage (could be buggy) // count = std::tr1::get<0>(stats); // free function usage Also: #include <tr1/tuple> // n-tuples I relealize this is the TR1 version and not the Boost version. Please let me know if some stripped down example code would be useful. My development environment for the record: boost : 1.34.1 (via ./configure; make all; make install) gcc : 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) os : Ubuntu 6.10, Linux 2.6.17-12-generic (7.04 is current) hardware : Toshiba Tecra A2 330 laptop (purchased Aug-2004) cheers Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Institute for Energy Engineering (IET) Technical University of Berlin (TU-Berlin), Germany [from IMAP client]

on Fri Oct 19 2007, Robbie Morrison <robbie-AT-actrix.co.nz> wrote:
What is all the above supposed to mean?
Does this really have anything to do with mpl::at_c, as the subject implies? It looks like it's all about tuples. Also, is it the Boost implementation of tr1 or some other vendor's? If you have found a bug, please enter a ticket by following the newticket link at http://svn.boost.org/trac/boost. Thanks.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com

I was mistaken about what was generating the compile error. I think it had to do with there not being a get member function in boost::tuple<int> This confused me since I thought I had used that in the past, and the doc's suggested it worked. Chris

Chris Weed wrote:
Change that to: { return t.template get<0>(); } Chris Weed wrote:
Actually, there is a get member. The problem was that the compiler didn't know the type of t when compiling the function (because t is a template dependent name), so you need to tell it that 'get' is a template method. Because it didn't know that, it assumed the angle brackets were actually 'less than' and 'greater than' symbols, leading to the confusing error messages. Daniel

David Abrahams schrieb: -----------------------------------------------------------
What is all the above supposed to mean?
It's about that there's no boost::tuple method named get as shown in the current documentation at http://boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements I have already asked for clearing up that issue in the documentation at the [boost-docs] list. I hope that this will be answered. Regards, Vinzenz Feenstra
participants (5)
-
Chris Weed
-
Daniel James
-
David Abrahams
-
Robbie Morrison
-
Vinzenz 'evilissimo' Feenstra