-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) 2024 Daniel Frey and Dr. Colin Hirsch | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef TAO_PQ_IS_ARRAY_HPP | ||
#define TAO_PQ_IS_ARRAY_HPP | ||
|
||
#include <array> | ||
#include <cstddef> | ||
#include <list> | ||
#include <set> | ||
#include <unordered_set> | ||
#include <utility> | ||
#include <vector> | ||
|
||
namespace tao::pq | ||
{ | ||
namespace internal | ||
{ | ||
template< typename > | ||
inline constexpr bool is_array_parameter = false; | ||
|
||
template< typename T, std::size_t N > | ||
inline constexpr bool is_array_parameter< std::array< T, N > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_parameter< std::list< Ts... > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_parameter< std::set< Ts... > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_parameter< std::unordered_set< Ts... > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_parameter< std::vector< Ts... > > = true; | ||
|
||
template<> | ||
inline constexpr bool is_array_parameter< std::vector< std::byte > > = false; | ||
|
||
template< typename > | ||
inline constexpr bool is_array_result = false; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_result< std::list< Ts... > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_result< std::set< Ts... > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_result< std::unordered_set< Ts... > > = true; | ||
|
||
template< typename... Ts > | ||
inline constexpr bool is_array_result< std::vector< Ts... > > = true; | ||
|
||
template<> | ||
inline constexpr bool is_array_result< std::vector< std::byte > > = false; | ||
|
||
} // namespace internal | ||
|
||
template< typename T > | ||
inline constexpr bool is_array_parameter = internal::is_array_parameter< T >; | ||
|
||
template< typename T > | ||
inline constexpr bool is_array_result = internal::is_array_result< T >; | ||
|
||
} // namespace tao::pq | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters