-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from ikbuibui/views
Enable views on existing resources
- Loading branch information
Showing
4 changed files
with
145 additions
and
10 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
#include <type_traits> | ||
|
||
namespace redGrapes::traits | ||
{ | ||
// Primary template for is_specialization_of | ||
template<typename, template<typename...> class> | ||
struct is_specialization_of : std::false_type | ||
{ | ||
}; | ||
|
||
// Specialization for types that are specializations of the template | ||
template<typename... Args, template<typename...> class Template> | ||
struct is_specialization_of<Template<Args...>, Template> : std::true_type | ||
{ | ||
}; | ||
|
||
template<typename T = std::false_type, typename...> | ||
struct first_type | ||
{ | ||
using type = T; | ||
}; | ||
|
||
// Convenience alias template | ||
template<typename... Ts> | ||
using first_type_t = typename first_type<Ts...>::type; | ||
|
||
} // namespace redGrapes::traits |