Skip to content

Commit

Permalink
Explicitly disambiguate primary templates
Browse files Browse the repository at this point in the history
  • Loading branch information
krOoze committed Oct 8, 2019
1 parent 6129ad5 commit e8a3834
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/EnumerateScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
#ifndef COMMON_ENUMERATE_SCHEME_H
#define COMMON_ENUMERATE_SCHEME_H

#include <vector>
#include <functional>
#include <type_traits>
#include <vector>

#include <vulkan/vulkan.h>

Expand Down Expand Up @@ -44,10 +45,11 @@ std::vector<Element> enumerateScheme( Cmd cmd, const char* cmdName ){
// Adapters for specific Vulkan commands
///////////////////////////////////////////////

template< typename Element, typename... Ts >
template< typename Element, typename... Ts, typename = std::enable_if_t<!std::is_same<Element, VkInstance>::value> >
std::vector<Element> enumerate( Ts... );

template< typename Tag, typename Element, typename... Ts >
// Tag will be VkInstance if to disambiguate commands that also work on device
template< typename Tag, typename Element, typename... Ts, typename = std::enable_if_t<std::is_same<Tag, VkInstance>::value> >
std::vector<Element> enumerate( Ts... );

// for vkEnumerateInstanceLayerProperties -- auto v = enumerate<VkInstance, VkLayerProperties>();
Expand Down

0 comments on commit e8a3834

Please sign in to comment.