mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-08-01 05:17:13 +02:00
Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
//
|
||||
// MetaProgramming.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: MetaProgramming
|
||||
//
|
||||
// Common definitions useful for Meta Template Programming
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_MetaProgramming_INCLUDED
|
||||
#define Foundation_MetaProgramming_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IsReference
|
||||
/// Use this struct to determine if a template type is a reference.
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 0
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IsReference<T&>
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IsReference<const T&>
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IsConst
|
||||
/// Use this struct to determine if a template type is a const type.
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 0
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IsConst<const T&>
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IsConst<const T>
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T, int i>
|
||||
struct IsConst<const T[i]>
|
||||
/// Specialization for const char arrays
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct TypeWrapper
|
||||
/// Use the type wrapper if you want to decouple constness and references from template types.
|
||||
{
|
||||
typedef T TYPE;
|
||||
typedef const T CONSTTYPE;
|
||||
typedef T& REFTYPE;
|
||||
typedef const T& CONSTREFTYPE;
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct TypeWrapper<const T>
|
||||
{
|
||||
typedef T TYPE;
|
||||
typedef const T CONSTTYPE;
|
||||
typedef T& REFTYPE;
|
||||
typedef const T& CONSTREFTYPE;
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct TypeWrapper<const T&>
|
||||
{
|
||||
typedef T TYPE;
|
||||
typedef const T CONSTTYPE;
|
||||
typedef T& REFTYPE;
|
||||
typedef const T& CONSTREFTYPE;
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct TypeWrapper<T&>
|
||||
{
|
||||
typedef T TYPE;
|
||||
typedef const T CONSTTYPE;
|
||||
typedef T& REFTYPE;
|
||||
typedef const T& CONSTREFTYPE;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_MetaProgramming_INCLUDED
|
||||
Reference in New Issue
Block a user