Skip to content

Template Arguments for Generators? #8214

Answered by abadams
FabianSchuetze asked this question in Q&A
Discussion options

You must be logged in to vote

You should really be using a GeneratorParam for something like a channel count. The only reason for it to be a template parameter is if you need the channel count to be constexpr for some other reason (e.g. you call a function written by someone else that's templated on the channel count).

However, pressing on, this is a c++ CRTP wart. When you use CRTP like this:

template<typename T>
class Foo : public Generator<Foo<T>> {

Then names from the base class don't get inherited by default. It's super annoying. For members you typically just add a this-> before them, but your problem is with types that belong to the Generator base class. I think this can be solved with some using statements in…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@FabianSchuetze
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by FabianSchuetze
Comment options

You must be logged in to vote
1 reply
@FabianSchuetze
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants