diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h')
-rw-r--r-- | contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h | 282 |
1 files changed, 141 insertions, 141 deletions
diff --git a/contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h b/contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h index 9fe168b813..ba68fe054c 100644 --- a/contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h +++ b/contrib/libs/poco/Foundation/include/Poco/MetaProgramming.h @@ -1,144 +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. -{ +// +// 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 = 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. -{ + { + VALUE = 1 + }; +}; + + +template <typename T> +struct IsReference<const T&> +{ 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 -{ + { + 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 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 + { + 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 |