My code is like this:
void some_func(void *source)
{
...
double *casted = reinterpret_cast<double *>(source);
...
}
This causes std::__non_rtti_object
exception. Acording to stack trace, it is raised from __RTDynamicCast
, which is (as far as i know) MSVC implementation of dynamic_cast.
This exception should occur with dynamic_cast, as the pointer comes from external library (probably compiled without /GR) and points to struct with several doubles. But I would not expect this with reinterpret_cast. Shouldn't it just change the type of the pointer, without any checks at all?
Notes:
- my compiler is msvc120 (MS Visual Studio 2013)
- project is compiled with /GR (enable run-time type information)
- pointer "source" comes from external library (probably compiled without /GR)
- I also tried static_cast with the same result