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,262
  • 2
  • 34
  • 36
Bob
  • 10,741
  • 27
  • 89
  • 143

2 Answers2

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

or

std::make_pair(false, false)
unsym
  • 2,080
  • 1
  • 20
  • 19
0

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

ephemient
  • 198,619
  • 38
  • 280
  • 391