Re: Types prefixed by "class" or "struct" string??

Paul Koning
2020-02-21T14:55:12Z

> On Feb 21, 2020, at 9:48 AM, Paul Smith <psmith@gnu.org> wrote:
>
> ...
> If I try to look up a type without the "class " prefix it works fine:
>
> (gdb) python
>> t = gdb.lookup_type('std::__cxx11::list<Object::Pending, std::allocator<Object::Pending> >::_Node')
>> print str(t)
>> ^D
> std::__cxx11::list<Object::Pending, std::allocator<Object::Pending> >::_Node
>
> But, if I try to look up the type including the "class " it definitely
> fails:

Well, sure. "class" is not part of the name of the type.

Also note that class and struct are basically synonyms, the only difference is whether the default access is private (class) or public (struct). While by tradition "struct" is used when defining "plain old data" that is not a requirement.

paul