C++ STL pair initialization problem


Hi guys, CLion doesn't recognize this line of code below 

pair1 = make_pair(123,"hello");

I have included utility library also. And CLion said that

main.cpp:18:%: error: use of undeclared identifier 'pair1'

I don't know how to fix it. So please help me. 

Any help would be greatly appreciated. 

1 comment
Comment actions Permalink


See examples in https://en.cppreference.com/w/cpp/utility/pair/make_pair and try this

auto pair1 = std::make_pair(123, "hello");

Please sign in to leave a comment.