On 13 May 2009, at 15:16, Тимофей Даньшин wrote:
Hi there.
Here is a C++ constructor that is said to work on Windows (i.e., the
guy who wrote it says it works on Win), but doesn't work on Mac. Is
there a way to fix it, except by replacing it with a "copy" method?
Cbyte1::Cbyte1 (Cbyte1 &v
Your copy constructor is atypical because the argument is not const
(or a non reference).
You could change it to be:
Cbyte1::Cbyte1 (const Cbyte1 &val)
Secondly, it looks like your class is a template. In that case you may
either want:
template
class Cbyte1
{
Cbyte1 (const
in addition to this copy-constructor, had you provided a default
constructor?
in addition try to using the copy constructor with const parameter has
show below.
Cbyte1::Cbyte1 (const Cbyte1 &val)
{
// SOMETHING
}
Luca.
___
Hi there.
Here is a C++ constructor that is said to work on Windows (i.e., the
guy who wrote it says it works on Win), but doesn't work on Mac. Is
there a way to fix it, except by replacing it with a "copy" method?
Cbyte1::Cbyte1 (Cbyte1 &val) {
m_size = val.m_size;
if (m_s