Skip to content

Commit

Permalink
improved attributeset from niko
Browse files Browse the repository at this point in the history
  • Loading branch information
m0dB authored and m0dB committed Nov 2, 2024
1 parent c2d6c44 commit 8b25d13
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rendergraph/common/rendergraph/attributeset.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
#include "rendergraph/attributeinit.h"

namespace rendergraph {
class AttributeSet;
}

class rendergraph::AttributeSet : public rendergraph::BaseAttributeSet {
class AttributeSet : public BaseAttributeSet {
public:
AttributeSet(std::initializer_list<AttributeInit> list, const std::vector<QString>& names);
};

namespace rendergraph {
template<typename... T>
AttributeSet makeAttributeSet(const std::vector<QString>& names) {
return AttributeSet({(AttributeInit::create<T>())...}, names);
template<typename... Ts, int N>
AttributeSet makeAttributeSet(const QString (&names)[N]) {
static_assert(sizeof...(Ts) == N);
return AttributeSet({(AttributeInit::create<Ts>())...},
std::vector<QString>(std::cbegin(names), std::cend(names)));
}

} // namespace rendergraph

0 comments on commit 8b25d13

Please sign in to comment.