最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

報(bào)錯(cuò)non-const static data member must be initialized out of line的2

2021-12-11 17:45 作者:LogByMax  | 我要投稿

記錄工作中遇到的錯(cuò)誤。


eg.

#include <iostream>

class Cube

{

int static length_ = 2;

};

會(huì)報(bào)錯(cuò)non-const static data member must be initialized out of line

解決方法:

solu-1: 把此靜態(tài)成員變量加設(shè)為const

solu-1-eg.

#include <iostream>

class Cube

{

const?int static length_ = 2;

};

solu-2:把次靜態(tài)成員變量放到類外定義

solu-2-eg.

#include <iostream>

int static length_ = 2;

class Cube

{

};


=reference=

[1]https://blog.csdn.net/nlforever/article/details/9313587

報(bào)錯(cuò)non-const static data member must be initialized out of line的2的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
庆安县| 广元市| 广宗县| 宁乡县| 平阳县| 恩平市| 海林市| 蒙自县| 同德县| 金寨县| 铁力市| 富平县| 广南县| 专栏| 霍城县| 盘锦市| 田东县| 达尔| 信宜市| 万盛区| 家居| 甘德县| 昌图县| 修武县| 达孜县| 永安市| 彩票| 葫芦岛市| 常州市| 诸城市| 四会市| 维西| 深州市| 屏山县| 东台市| 铜梁县| 克东县| 龙里县| 广东省| 沅江市| 刚察县|