//*****************************************************************************
// RCF - Remote Call Framework
// Copyright (c) 2005. All rights reserved.
// Developed by Jarl Lindrud.
// Contact: jlindrud@hotmail.com .
//*****************************************************************************
#ifndef INCLUDE_RCF_CHECKRTTI_HPP
#define INCLUDE_RCF_CHECKRTTI_HPP
namespace RCF {
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( error : 4541 ) // error C4541: 'dynamic_cast' used on polymorphic type 'RCF::TestRtti::B' with /GR-; unpredictable behavior may result
#endif // _MSC_VER
class TestRtti
{
struct A
{
virtual ~A()
{}
};
struct B
{
virtual ~B()
{}
};
void operator()()
{
B b;
// RTTI support not detected!
// If you're using Visual C++, set "Enable Run-Time Type Info" to true, in the Project Properties | C/C++ | Language options,
dynamic_cast<A &>(b);
}
};
#ifdef _MSC_VER
#pragma warning( pop )
#endif // _MSC_VER
} // namespace RCF
#endif // ! INCLUDE_RCF_CHECKRTTI_HPP