Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-10-18 11:18:29


While we are on the topic:

The article

http://www.cuj.com/experts/1912/hyslop.htm

asserts that any_cast will work unqualified due to Koenig lookup. However,
note that it has an explicit template parameter. I'm not sure whether
argument dependent lookup will work in this case. Indeed, the online Comeau
rejects it:

namespace boost
{
  template<class T, class U> T any_cast(U);
  class any {};
}

int main()
{
  boost::any a;
  any_cast<int>(a);
}

"20126.c", line 10: error: identifier "any_cast" is undefined
    any_cast<int>(a);
    ^

"20126.c", line 10: error: type name is not allowed
    any_cast<int>(a);
             ^

--
Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk