小编Cat*_*Dog的帖子

gdb print命令中自包含的字符串子类的递归输出

大家,

我正在使用OpenFOAM,它自己创建了Foam :: string和Foam :: word类型:

(gdb) ptype Foam::word
type = class Foam::word : public Foam::string {
  public:
    static pointer typeName;
    static int debug;
    static const Foam::word null;

  private:
    void stripInvalid(void);
  public:
    word(void);
    word(const Foam::word &);
    word(pointer, bool);
    word(pointer, size_type, bool);
    word(const Foam::string &, bool);
    word(const std::__cxx11::string &, bool);
    word(Foam::Istream &);
    static bool valid(char);
    void operator=(const Foam::word &);
    void operator=(const Foam::string &);
    void operator=(const std::__cxx11::string &);
    void operator=(pointer);
}
(gdb) ptype Foam::string
type = class Foam::string : public std::__cxx11::basic_string<char, std::char_traits<char>, …
Run Code Online (Sandbox Code Playgroud)

c++ static gdb class self-contained

5
推荐指数
1
解决办法
281
查看次数

如何在编译期间输出c ++类型信息

大家.我正在调试一个严重模板类的类型不匹配的问题.我想在编译期间知道c ++类型信息,所以我写这个:

#pragma message typeinfo(var)
Run Code Online (Sandbox Code Playgroud)

它只是不起作用.

所以我在这里寻求帮助.我不确定是否有可能.但我认为编译器必须知道编译期间的类型信息.

c++ types

4
推荐指数
1
解决办法
2652
查看次数

标签 统计

c++ ×2

class ×1

gdb ×1

self-contained ×1

static ×1

types ×1