vendredi 4 octobre 2019

C++ class template instantiation delay, STL bitset

I know the following code is wrong. I should a give fixed constant N, but I want to change this to a variable N.

#include <bitset>

using namespace std;

class C {
 public:
  C(int N) {
    bitset<N> b;
  }
};

int main() {
  C c(123); // How to coding it?
}

Aucun commentaire:

Enregistrer un commentaire