No. Here's how you should create your pair:
auto tmp = std::make_pair(1, num{1.0, 2.0});
Or alternatively (as @StoryTeller mentioned):
std::pair<int,num> tmp {1, {1.0, 2.0}};
Now, in both cases, the compiler has a clue to what the {1.0, 2.0}initializer means for num.
source
share