网上的烂文章而已,应该是:pair<int, const char*>
19│ #include <utility>
20│
21│ int main()
22│ {
23│ std::pair mp {13, "hello"};
24├───> return mp.first;
25│ }
/home/anhong/main.cpp
Reading symbols from a.out...done.
(gdb) start
Temporary breakpoint 1 at 0x64d: file main.cpp, line 22.
Starting program: /home/anhong/a.out
Temporary breakpoint 1, main () at main.cpp:22
(gdb) n
(gdb)
(gdb) ptype mp
type = struct std::pair<int, char const*> [with _T1 = int, _T2 = const char *]
: private std::__pair_base<_T1, char const*> {
_T1 first;
_T2 second;
public:
pair(const std::pair<_T1, char const*> &);
pair(std::pair<_T1, char const*> &&);
std::pair<_T1, char const*> & operator=(std::conditional<true, std::pair<_T1, char const*> const&, std::__nonesuch_no_braces const&>::type);
std::pair<_T1, char const*> & operator=(std::conditional<true, std::pair<_T1, char const*>&&, std::__nonesuch_no_braces&&>::type);
void swap(std::pair<_T1, char const*> &);
}
--
FROM 73.63.211.*