
Hi Pavel, pavel5 wrote:
I am trying to realize class for strings caching using boost::multi_index. [...] My class works without any problem, but i want to have template class, for easily type of key and value selection. I modified my source: [...] After modification, gcc compiler prints for line:
LRUCacheItems::nth_index<0>::type& hash_index=cache.get<0>();
many errors:[...]
Replace the offending line with typename LRUCacheItems::nth_index<0>::type& hash_index=cache.template get<0>(); Note the extra "typename" and also the "template" keyword between "cache." and "get<0>()". After templatizing your LRUCache, the expression happens to be in a so-called dependent context, and turns out you've got to help the compiler figure it out right (i.e. disambiguate from some other interpretations theoretically possible in the given context). Learn more about this issue at http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=388 Hope this helps, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -- View this message in context: http://www.nabble.com/realization-of-Last-Recently-Used-cache-with-boost%3A%... Sent from the Boost - Users mailing list archive at Nabble.com.