octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ov.h: class octave_value should not contain static members


From: CdeMills
Subject: ov.h: class octave_value should not contain static members
Date: Thu, 20 Jan 2011 01:12:18 -0800 (PST)

Hello,

while trying to make octave_value thread-safe, I tried the following
modifications:
- have a class with no dynamic data management:

class
OCTINTERP_API
octave_void
{
 public:

  octave_void (void)
    {
      static octave_base_value nil_rep;
      rep = &nil_rep;
    }
 protected:
  
  // The real representation.
  octave_base_value *rep;  

};

then, derive octave_base from it, and
1) remove the no-arg constructor, as it returns something linked to static
data, for which there should be no access to "count".
2) change empty_conv as
  static octave_value empty_conv (const std::string& type,
                                  const octave_void& rhs = octave_void ());
I don't pretend this code is correct -- I'm trying to separate data
conversion from dynamic objects management. Compilation fails with
./liboctave/oct-mem.h:131: error: no matching function for call to
'octave_value::octave_value()'

Looking in oct-mem.h, the code is
template <class T>
inline T *no_ctor_new (size_t n)
  safe_size_comp (n, sizeof (T));
  return new T[n]; 
}

How can I trace this error, that is, find the code which calls 
octave_value::octave_value() ?

Regards

Pascal
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/ov-h-class-octave-value-should-not-contain-static-members-tp3225486p3225486.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]