zzzbbx
zzzbbx

Reputation: 10131

initialize vector of pairs

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

Upvotes: 1

Views: 3980

Answers (2)

unsym
unsym

Reputation: 2200

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

or

std::make_pair(false, false)

Upvotes: 4

ephemient
ephemient

Reputation: 204678

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

Upvotes: 0

Related Questions