.. _program_listing_file_nvcv_types_include_nvcv_detail_TypeTraits.hpp: Program Listing for File TypeTraits.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``nvcv_types/include/nvcv/detail/TypeTraits.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NVCV_TYPE_TRAITS_HPP #define NVCV_TYPE_TRAITS_HPP #include #include namespace nvcv { namespace detail { template using EnableIf_t = typename std::enable_if::type; template using Conditional_t = typename std::conditional::type; template using AddPointer_t = typename std::add_pointer::type; template using AddLRef_t = typename std::add_lvalue_reference::type; template using AddRRef_t = typename std::add_rvalue_reference::type; template using RemovePointer_t = typename std::remove_pointer::type; template using RemoveRef_t = typename std::remove_reference::type; template using RemoveCV_t = typename std::remove_cv::type; template using RemoveCVRef_t = RemoveCV_t>; template std::is_convertible()(std::declval()...)), R> IsInvocableRF(F *); template std::false_type IsInvocableRF(...); template struct IsInvocableR : decltype(IsInvocableRF(AddPointer_t())) { }; template()(std::declval()...))> std::true_type IsInvocableF(F *); template std::false_type IsInvocableF(...); template struct IsInvocable : decltype(IsInvocableF(AddPointer_t())) { }; template struct Conjunction : std::true_type { }; template struct ConjunctionImpl; template struct Conjunction : ConjunctionImpl { }; template struct ConjunctionImpl : std::false_type { }; template struct ConjunctionImpl : Conjunction { }; template struct Disjunction : std::false_type { }; template struct DisjunctionImpl; template struct Disjunction : DisjunctionImpl { }; template struct DisjunctionImpl : std::true_type { }; template struct DisjunctionImpl : Disjunction { }; // std::function recognizer std::false_type IsStdFunctionF(...); template std::true_type IsStdFunctionF(const std::function *); template struct IsStdFunction : decltype(IsStdFunctionF(std::declval())) { }; // std::reference_wrapper recognizer std::false_type IsRefWrapperF(...); template std::false_type IsRefWrapperF(const std::reference_wrapper *); template struct IsRefWrapper : decltype(IsRefWrapperF(std::declval())) { }; }} // namespace nvcv::detail #endif // NVCV_TYPE_TRAITS_HPP