initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
36
libs/wxWidgets-3.3.1/include/wx/meta/convertible.h
Normal file
36
libs/wxWidgets-3.3.1/include/wx/meta/convertible.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/meta/convertible.h
|
||||
// Purpose: Test if types are convertible
|
||||
// Author: Arne Steinarson
|
||||
// Created: 2008-01-10
|
||||
// Copyright: (c) 2008 Arne Steinarson
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_META_CONVERTIBLE_H_
|
||||
#define _WX_META_CONVERTIBLE_H_
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
// NOTE: this class is obsolete and provided only for compatibility, please use
|
||||
// the standard class instead.
|
||||
//
|
||||
// Helper to decide if an object of type D is convertible to type B (the test
|
||||
// succeeds in particular when D derives from B)
|
||||
template <class D, class B>
|
||||
using wxConvertibleTo = std::is_convertible<D*, B*>;
|
||||
|
||||
// This is similar to wxConvertibleTo, except that the case of D deriving from
|
||||
// B non-publicly will be detected and the correct value (false) will be
|
||||
// deduced.
|
||||
template <class D, class B>
|
||||
struct wxIsPubliclyDerived
|
||||
{
|
||||
enum
|
||||
{
|
||||
value = std::is_base_of<B, D>::value && std::is_convertible<D*, B*>::value
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _WX_META_CONVERTIBLE_H_
|
||||
|
||||
Reference in New Issue
Block a user