
13 Jan
2008
13 Jan
'08
7:40 a.m.
Hello, I'd like to provide a function with an unique identifier: void f(size_t UniqueId); This function is going to be called from within class member functions like that: class a { a() { f((size_t)this); } }; Right now the old style cast works. The question is how do I make conversion using numeric_cast? If I use: f(boost::numeric_cast<size_t>(this)); I get a compilation error: error C2665: 'ceil' : none of the 3 overloads could convert all the argument types I guess another question is: should I bother replacing this old-style cast, maybe there is a better way to approach this situation in general? Thanks.