initialize vector of pairs

2019-07-26 16:59发布

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

2条回答
混吃等死
2楼-- · 2019-07-26 17:14
std::pair<bool,bool>(false, false)

or

std::make_pair(false, false)
查看更多
在下西门庆
3楼-- · 2019-07-26 17:36

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

查看更多
登录 后发表回答