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

歡迎光臨散文網(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ó)家法律
元氏县| 永春县| 百色市| 上蔡县| 东乡| 贵阳市| 南昌县| 长白| 乡宁县| 商河县| 卢氏县| 成武县| 大荔县| 江北区| 长寿区| 屏南县| 安泽县| 清苑县| 鲁甸县| 理塘县| 肇庆市| 龙门县| 五莲县| 望城县| 五河县| 北川| 个旧市| 阿瓦提县| 姚安县| 定边县| 合山市| 台北县| 寻甸| 西平县| 泽普县| 衡南县| 蛟河市| 康马县| 龙井市| 永顺县| 保亭|