Confused about template Parameter pack usage (c++-11)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Confused about template Parameter pack usage (c++-11)

Robert Heller
I am trying to create a template class that is a container of sorts for some
fixed number of another ("normal") class. This is what I have, and it compiles
with gcc version 4.9.2 (Raspbian 4.9.2-10+deb8u1), but I am unsure if it is
just what I want):

template <int N>class ht16K33_5x7_gang : public Adafruit_GFX {        
    template <uint8_t... > void begin(uint8_t...);                    
    size_t write(uint8_t c);                                          
    size_t write(uint8_t c, uint8_t p);                                
    void drawPixel(int16_t x, int16_t y, uint16_t color);              
    ht16K33_5x7 gangMembers[N];                                        
    uint8_t position;                                                  

Right now, my problem is with the begin() function. I would like it to have
*exactly* N uint8_t arguments, but I don't know how to do that exactly (or
even if it is possible).

Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services  -- Linux Administration Services
[hidden email]       -- Webhosting Services
help-gplusplus mailing list
[hidden email]