小编MeJ*_*MeJ的帖子

在包装的命令行中//解开空格

我使用uncrustify与以下参数:

sp_cmt_cpp_start                = force         # Add space after opening '//'
cmt_width                       = 78  
Run Code Online (Sandbox Code Playgroud)

输入:

bi.dwSize = sizeof (bi); //Size of the structure itself, must be initialized with sizeof(CGOSBOARDINFO)

输出:

bi.dwSize = sizeof(bi); // Size of the structure itself, must be
                              //initialized with sizeof(CGOSBOARDINFO)
Run Code Online (Sandbox Code Playgroud)

但在第二行//后"//初始化"应该像:

bi.dwSize = sizeof(bi); // Size of the structure itself, must be
                              // initialized with sizeof(CGOSBOARDINFO)
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个小问题?

c c++ uncrustify

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

QtDBUS:通过DBUS发送枚举

我在c ++中使用qt dbus绑定。

目前,我可以通过dbus发送任何自定义类型(例如:类,结构),但无法发送枚举。

我也在这里尝试了此链接,但没有得到

c++ enums qt ipc qtdbus

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

C++ 11:v = {}和v {}之间的区别

我想问一下以下两个陈述之间是否有任何区别:

// C++11
std::vector<int> d {1, 2, 3};
std::vector<int> d = {1, 2, 3};
Run Code Online (Sandbox Code Playgroud)

在这两种情况下都会调用序列构造函数:

class A {
public:
  int a;

  A() {
    cout << "default constructor" << endl;
  };

  A(const A& other) {
    cout << "copy constructor" << endl;
  };

  A& operator =(const A& other) {
    cout << "assignment operator" << endl;
  }

  A(std::initializer_list<int> e) {
    cout << "sequence constructor" << endl;
  };

  A& operator =(std::initializer_list<int> e) {
    cout << "initializer list assignment operator" << endl;
  }
};

int …
Run Code Online (Sandbox Code Playgroud)

c++ c++11

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

Boost :: format十六进制输出

我正在使用boost :: format来创建和格式化字符串.

我想创建以下输出:

数据:0x64 - 名称:'xxx',值:10

我尝试了以下行:

boost::format("Data:  %|02x|%1% - Name: '%2%', Value: %3%") % code % name % value);
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

我知道第一个参数的形成是错误的,但我无法解决它.

是否有可能将第一个参数打印为十六进制?

c++ boost string-formatting

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

Jenkins - Email-ext 插件在电子邮件中显示作业名称

有没有一种简单的方法可以在电子邮件主题中包含职位的显示名称?

也许有一个环境变量可以做到这一点?

我知道这应该是可能的,因为詹金斯中的默认功能(电子邮件通知)已经在电子邮件主题中提供了此信息。

jenkins jenkins-plugins email-ext

2
推荐指数
1
解决办法
2231
查看次数