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: John W. Eaton
Subject: ov.h: class octave_value should not contain static members
Date: Thu, 20 Jan 2011 04:16:42 -0500

On 20-Jan-2011, CdeMills wrote:

| 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() ?

Is that all the error message you get?  Aren't there additional error
messages associated with this one that tells you  where oct-mem.h was
included from?

jwe


reply via email to

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