In the way you asked ...
NO.
There is no function (code to be executed) that can give such a result, since standard C++ has
no reflection.
The standard RTTI is tailored to support dynamic_cast and have no role on enums.
Things may be different if we consider some language extensions (like C++/CLI, that is an ECMA standard not accepted by ANSI that is the owner of the C++ standard ...) that can add reflection and hence the capability to query at runtime the state of the source.
Of course there can be tricks like
enum E
{
a,b,c, count;
};
That leads to a=0, b=1, c=2, count=3. But that's a different thing respect to what you asked (may be not adequate, for certain purpose).