Given a simple class like
class test {
private:
size_t size_;
int* data_;
public:
test(size_t s)
: size_(s), data_(new int[s]
{ /* ... */ };
};
I'm curious as to whether there's any differance if I change the
initialization list to:
: size(s), data_(new int[size_])
if we disregard the possible trouble that might cause if I happened to
declare data_ first?
--
Erik Wikström
class test {
private:
size_t size_;
int* data_;
public:
test(size_t s)
: size_(s), data_(new int[s]
{ /* ... */ };
};
I'm curious as to whether there's any differance if I change the
initialization list to:
: size(s), data_(new int[size_])
if we disregard the possible trouble that might cause if I happened to
declare data_ first?
--
Erik Wikström
Comment