SourceForge logo
SourceForge logo
Menu

wxlua-users

From: Klaas H. <db...@nl...> - 2008年05月06日 13:19:21
Attachments: db348.vcf
Hi John,
This first few wrap fine.
 %operator a2dDoMu& operator=( const a2dDoMu& );
 %operator a2dDoMu& operator=( const wxChar* );
 %operator a2dDoMu& operator=( double );
 %operator int operator==( const a2dDoMu& ) const;
 %operator int operator!=( const a2dDoMu& ) const;
But this one refuses:
 %operator operator double();
The idea behind this class is to store internal numbers as "1.23 um" or "1.2 
inch" etc., and the double operator is how to get the value as a single double.
Not a great problem at the moment.
But maybe you can fix it for a next version of wxLua.
Thanks,
Klaas
-- 
Unclassified
From: John L. <jla...@gm...> - 2008年05月13日 04:13:41
On Tue, May 6, 2008 at 9:18 AM, Klaas Holwerda <db...@nl...> wrote:
> Hi John,
>
> This first few wrap fine.
>
> %operator a2dDoMu& operator=( const a2dDoMu& );
> %operator a2dDoMu& operator=( const wxChar* );
> %operator a2dDoMu& operator=( double );
> %operator int operator==( const a2dDoMu& ) const;
> %operator int operator!=( const a2dDoMu& ) const;
>
> But this one refuses:
>
> %operator operator double();
>
> The idea behind this class is to store internal numbers as "1.23 um" or
> "1.2 inch" etc., and the double operator is how to get the value as a single
> double.
>
> Not a great problem at the moment.
> But maybe you can fix it for a next version of wxLua.
Humm, I hadn't thought about adding the typecasting operators. The Lua
syntax might be a little weird for this though, "obj:op_double()",
maybe it might make more sense to add a more readable function
obj:GetAsDouble() or something.
Regards,
 John
From: andre a. <ar...@ki...> - 2008年05月15日 21:08:34
Hi John,
> Humm, I hadn't thought about adding the typecasting operators. The Lua
> syntax might be a little weird for this though, "obj:op_double()",
> maybe it might make more sense to add a more readable function
> obj:GetAsDouble() or something.
> 
Note that if you choose GetAsDouble then 
obj.AsDouble should be available for consistencies.
Andre
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /