octave-maintainers
[Top][All Lists]
Advanced

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

Minimalistic func with new type definition, why does it fail ?


From: CdeMills
Subject: Minimalistic func with new type definition, why does it fail ?
Date: Sat, 31 Aug 2013 06:36:30 -0700 (PDT)

Hello,

In the idea of defining a new multi-precision scalar type, I started from
examples/make_int.cc; removed most of the stuff in order to reproduce the
issue. The new type is derived from octave_base_value; there is only an
increment operation. Upon first call of make_shortint(), the type is
registred and the first object created. 

The failure occurs as:

 x = make_shortint(3); x++
oct_unop_incr called with type 0: <unknown type>; class:unknown; val:0
Which can't be translated to octave_integer type 54: integer;
class:octave_integer; val:0
Exception occured std::bad_cast
while x = make_shortint(4); ++x succeeds

Why do post-incrementation fails ? Basically octave_integer::oct_unop_incr
is called with an octave_base_value object and not an octave_integer object.
What did I miss ?

Regards

Pascal
make_shortint.cc
<http://octave.1599824.n4.nabble.com/file/n4656958/make_shortint.cc>  




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Minimalistic-func-with-new-type-definition-why-does-it-fail-tp4656958.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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