Hello,
I was using the boost tuples library (from boost 1.31) to create a cache key. However, the Solaris compiler (SUNWspro v6.2.p1) complained when I tried to access the last element in the tuple. My class looked something like this:
typedef enum result_type_id {
...
} ResultTypeID;
class ParamStateKey;
class Cache
{
typedef boost::tuple key_type;
// cache implementation
...
// some helper functions defined to hide the boost::tuple interface
static ParamStateKey &GetState(key_type &k) { return boost::tuples::get<0>(k); }
static ResultTypeID &GetGreek(key_type &k) { return boost::tuples::get<1>(k); }
static int &GetProduct(key_type &k) { return boost::tuples::get<2>(k); }
static int &GetSubpage(key_type &k) { return boost::tuples::get<3>(k); }
static int &GetBucket(key_type &k) { return boost::tuples::get<4>(k); }
static key_type MakeKey(const ParamStateKey &psk, ResultTypeID r, int p1, int p2, int bkt)
{
return boost::tuples::make_tuple(psk, r, p1, p2, bkt);
}
};
The solaris compiler complained whenever I tried to call Cache::GetBucket() with the following error:
"../../../../incl/3rd/boost/tuple/detail/tuple_basic.hpp", line 105: Error: Could not find a match for boost::tuples::detail::get_class<0>::get::RET, boost::tuples::detail::get_class<0>::HT, boost::tuples::detail::get_class<0>::TT>(boost::tuples::cons).
"../../../../incl/3rd/boost/tuple/detail/tuple_basic.hpp", line 105: Where: While instantiating "static boost::tuples::detail::get_class<1>::get>(boost::tuples::cons>&)".
"../../../../incl/3rd/boost/tuple/detail/tuple_basic.hpp", line 105: Where: Instantiated from non-template code.
Firstly, I have no way of deciphering that error message. Through trial and error, I found that removing the GetBucket() calls solved the problem. However, I needed these calls. I reasoned that since the other helper functions worked, it was a problem accessing the last element of the tuple. So I created a dummy entry in the tuple and redefined my typedef:
typedef boost::tuple key_type;
This work-around is fine, so this is not an urgent problem. But it seems like this should not be necessary.
________________________________________
Darren Gilbert
Associate Director
UBS - Equities Quantitative Strategies
Phone: +1 (312) 525-5766
Stein's law: "When a trend cannot continue it will stop."
-- Herb Stein, Chairman of the Council of Economic Advisors under Nixon
Visit our website at http://www.ubs.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.