由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] 为什么 const member 不能是 static.
相关主题
static initialization dependency c++compile error
c++标准函数传递一问member and friend
static vector 怎么 initialize ?Test your C++ knowledge...
C++ question引用的几个基本问题,有点糊涂
请教c++ interface class问题When are data members initialized? what about static data m
c++ 一问C++ question
What're the three types of memory allocated for C++ variables?C++一个string的小问题
in-class static member questionquestion about c++ constructor
相关话题的讨论汇总
话题: const话题: static话题: member话题: aug话题: tue
进入Programming版参与讨论
1 (共1页)
b***y
发帖数: 2799
1
☆─────────────────────────────────────☆
qxc (睡觉自然醒, 数钱手抽筋) 于 (Tue Aug 23 18:18:35 2005) 提到:
compiler 老抱怨说我不能把一个 const 的 string 设置成为 static member,
VS2005.
这里面有什么逻辑原因吗? 多谢。
☆─────────────────────────────────────☆
aZhu (a+zhu) 于 (Tue Aug 23 18:23:43 2005) 提到:
I guess you initialize it inside the class.
i think you can't
though
class A{
static const int = 7;
// ..
}
is legal,
class A{
static const string a = "aaa";
//...
}
is not ba?

☆─────────────────────────────────────☆
yunhai (飞纵
E*****7
发帖数: 128
2
WRONG: const data member of a class can be static!
(Comment: there are many misleading answers given by other persons in your original post.They are really misleading!)
c*******g
发帖数: 771
3
1 (共1页)
进入Programming版参与讨论
相关主题
question about c++ constructor请教c++ interface class问题
问一个C++ set和unordered_set iterator的问题c++ 一问
问一个java基础的初始化的问题,一直搞不明白What're the three types of memory allocated for C++ variables?
[合集] static const代替define的performance tradeoff在哪里?in-class static member question
static initialization dependency c++compile error
c++标准函数传递一问member and friend
static vector 怎么 initialize ?Test your C++ knowledge...
C++ question引用的几个基本问题,有点糊涂
相关话题的讨论汇总
话题: const话题: static话题: member话题: aug话题: tue