Please read the new rule regarding the restriction on the use of AI tools. ×

Tanish55's blog

By Tanish55, history, 14 months ago, In English

i have a vector of pairs vector<pair<int , bool >>v; lets say initial values of vector of pair v is : 1 -> 0 2 -> 1 3 -> 0 now i have want to again reset the boolean values of vector v to 0 s0 ,how can i do it without looping over vector v ?? is it possible

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
14 months ago, # |
  Vote: I like it +14 Vote: I do not like it

no

  • »
    »
    14 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    • »
      »
      »
      14 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      he will have to assign values anyway later on, clearing just makes the process 2 times slower, which is a very small constant.