Say I have a class C
with a field of type std::vector<boost::any>
. I have index operator const boost::any C::operator[](const size_t i);
but what if I wanted C::operator[](const size_t i)
to return the object held by the any
object at index i
rather than the any
-object itself? The function would need a variable return type... which is not possible. Is there some way by for example means of indirection to achieve this anyway?
问问题
110 次