1

I wanted to initialize a vector of pairs with something like this

std::vector< std::pair<bool, bool> > myvector(initSequence.size(), X );

what shall I substitute in place of X, if I want to initialize every pair with (false, false)?

Thank you

Soo Wei Tan
  • 3,212
  • 2
  • 33
  • 36
Bob
  • 10,159
  • 24
  • 84
  • 136

2 Answers2

4
std::pair<bool,bool>(false, false)

or

std::make_pair(false, false)
unsym
  • 1,950
  • 19
  • 19
0

Nothing. std::pair<bool, bool> will be default constructed as make_pair(false, false).

ephemient
  • 189,938
  • 36
  • 271
  • 385