由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ design problem
相关主题
说到cpp11 和 围棋的对比What's a transaction.
JetBrains自宫,大家可以给丫烧纸了,atom很牛的样子Volatile variables do not provide any atomicity (转载)
Server release了about critical section
atom的windows安装文件要100MB请教register
C++怎么保证2行代码atomic关于signal handler
C++11 大家有用过吗?一个multithread的问题(是不是有人觉的很简单?)
用volatile退出线程对不对?(C++)double-checked locking
C++ InitializeCriticalSection问题关于线程读写全局变量的问题
相关话题的讨论汇总
话题: atom话题: molecule话题: class
进入Programming版参与讨论
1 (共1页)
j****i
发帖数: 305
1
I have the following classes: Atom, Molecule (contains atoms). I also have
the CoordinatedAtom class
which derives from Atom and contains position information. My
CoordinatedMolecule class should derive
from Molecule, but needs to contain CoordinatedAtom, instead of Atom. How
should I write the
CoordinatedMolecule class? I think this might be a common design problem.
What I'm thinking is that
whether I could define a member variable in CoordinatedMolecule that has the
same name as the base
class
D*******a
发帖数: 3688
2
use template
Molecule
Molecule

the

【在 j****i 的大作中提到】
: I have the following classes: Atom, Molecule (contains atoms). I also have
: the CoordinatedAtom class
: which derives from Atom and contains position information. My
: CoordinatedMolecule class should derive
: from Molecule, but needs to contain CoordinatedAtom, instead of Atom. How
: should I write the
: CoordinatedMolecule class? I think this might be a common design problem.
: What I'm thinking is that
: whether I could define a member variable in CoordinatedMolecule that has the
: same name as the base

1 (共1页)
进入Programming版参与讨论
相关主题
关于线程读写全局变量的问题C++怎么保证2行代码atomic
java的同步问题请教C++11 大家有用过吗?
Atomic operation 与 多重指针用volatile退出线程对不对?(C++)
c++是不是准备加一个glue layer把系统给隔离出来?C++ InitializeCriticalSection问题
说到cpp11 和 围棋的对比What's a transaction.
JetBrains自宫,大家可以给丫烧纸了,atom很牛的样子Volatile variables do not provide any atomicity (转载)
Server release了about critical section
atom的windows安装文件要100MB请教register
相关话题的讨论汇总
话题: atom话题: molecule话题: class