enesoncu's blog

By enesoncu, 9 years ago, In English

How can I find least one bit in bitset? I can't use A&-A where A is bitset.

  • Vote: I like it
  • +10
  • Vote: I do not like it

»
9 years ago, # |
Rev. 2   Vote: I like it +49 Vote: I do not like it

For C++

bitset<200> b;
b[33] = true;
cout << b._Find_first() << endl;
  • »
    »
    9 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Thank you very much. How can I reach info about this kind a functions? I searched web but I couldn't find information.

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I believe, you can find some info about standard library (and source codes too) here.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    I'd say it's for g++, not for c++.

    (It's not standard c++ and is not supported in MSVC (cf version))