From: Vadim Z. <vz...@ze...> - 2014-01-21 17:53:45
|
On Tue, 21 Jan 2014 07:47:30 +0000 William S Fulton <ws...@fu...> wrote: WSF> If you swap lines 20 and 21 to WSF> WSF> %naturalvar OptionalValue< T >; WSF> %template(Optional ## T) OptionalValue< T >; WSF> WSF> then "feature:naturalvar" does attach to OptionalValue<double>. Thanks, this does fix it. It makes me feel incredibly stupid, too. But it's still preferable to feeling smart but not having working code :-) so I'm very grateful nevertheless. WSF> > To summarize, e186d21 breaks my existing code (and probably not only mine) WSF> > and there doesn't seem to be any work around. So IMNSHO this is something WSF> > that should be fixed, even if by (partially) reverting this commit before WSF> > 3.0. WSF> > WSF> This is a concern, but I still mostly think that the fix is the correct WSF> approach and your current problem is because your code is wrong. I have a vague memory of having to do it like this, i.e. I think it actually didn't work in the other (correct) order before. Perhaps e186d21 fixed this. In any case, it's great that it works now. Of course, things always can be improved and it would be great if SWIG actually rejected, or at least warned about, %features appearing after the type definition -- or are there any situations in which this would be valid? Thanks again for your help! VZ |