Search:

Type: Posts; User: CornedBee

Search: Search took 0.22 seconds.

  1. Replies
    12
    Views
    1,648

    You're missing the point. The system as I...

    You're missing the point. The system as I presented it will automatically update the flags field when a feature is by some compile-time means included or excluded. Your way requires an explicit...
  2. Replies
    12
    Views
    1,648

    Good point. I originally meant to have this...

    Good point. I originally meant to have this hidden in a .cpp, but of course that's not possible since the changers are template instantiations.


    As with template functions, template static...
  3. Replies
    12
    Views
    1,648

    1) Compare: class NonTemplate { static int...

    1) Compare:

    class NonTemplate {
    static int var;
    };
    int NonTemplate::var;

    template <typename T>
    class Template {
    static int var;
  4. Replies
    12
    Views
    1,648

    Yep, my fault. If the static member isn't...

    Yep, my fault. If the static member isn't referenced, it isn't instantiated. Here's something that works.

    static unsigned featureField = 0;
    template <int N> struct FeatureRegisterer {
    ...
  5. Replies
    12
    Views
    1,648

    Something like this: static unsigned...

    Something like this:

    static unsigned featureField = 0;
    template <int N> struct FeatureRegisterer {
    FeatureRegisterer() { featureField |= 1 << N; }
    };
    enum Features {
    FeatureA, FeatureB,...
Results 1 to 5 of 5