阅读背景:

RAII在两个构造函数之间进行选择的方式

来源:互联网 

I have a class that holds a large table of data, with a constructor that takes all of the parameters needed to calculate that data. However, it takes a long time to run, so I've added a constructor that takes a stream, and reads the data in from that stream. I'm having trouble coming up with a RAII way of designing this class though, since I have two constructors, and at run time I need to choose between them. This is what I've come up with:I have a class that holds a large table of data




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: