mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-15 03:01:47 -07:00
Added support for predefining preprocessor defines before parsing strings of code.
This prevents issues for preprocessor defines not getting treated properly for specific circumstances (such as macro wrappers for specifiers).
This commit is contained in:
@ -5,6 +5,14 @@
|
||||
|
||||
#pragma region Containers
|
||||
|
||||
template<class TType> struct RemoveConst { typedef TType Type; };
|
||||
template<class TType> struct RemoveConst<const TType> { typedef TType Type; };
|
||||
template<class TType> struct RemoveConst<const TType[]> { typedef TType Type[]; };
|
||||
template<class TType, uw Size> struct RemoveConst<const TType[Size]> { typedef TType Type[Size]; };
|
||||
|
||||
template<class TType>
|
||||
using TRemoveConst = typename RemoveConst<TType>::Type;
|
||||
|
||||
template<class Type>
|
||||
struct Array
|
||||
{
|
||||
@ -167,7 +175,8 @@ struct Array
|
||||
|
||||
Header* get_header( void )
|
||||
{
|
||||
return rcast( Header*, Data ) - 1 ;
|
||||
using NonConstType = TRemoveConst< Type >;
|
||||
return rcast( Header*, const_cast<NonConstType*>(Data) ) - 1 ;
|
||||
}
|
||||
|
||||
bool grow( uw min_capacity )
|
||||
|
Reference in New Issue
Block a user