Hi there,

in the Sage library we cannot write the following C++ code:

  Class a = Class()

since Cython turns the statement

  cdef Class a = Class()

into

  Class a
  a = Class()

which only works when there is a copy constructor. In the Sage library we 
sometimes use the follow construct in order to work around this Cython vs. C++ 
incompatibility:

  Class a
  Construct<Class>(&a)

For example check the PolyBoRi wrapper and the NTL wrapper. There are also 
variants of this called Construct_p<Class>(&a, one_parameter) and so forth. 

I'm wrapping CryptoMiniSat at the moment (a general purpose (!) SAT solver 
which one this year's SAT Race). When I try to use this construct in my 
wrapper I get a complaint from g++ that Construct wasn't  defined in the 
scope; yet I cannot see what we are doing special in the PolyBoRi or NTL 
wrapper which would have an affect on that. Also searching online for this 
construction also returned nothing of interest as far as I can tell, mainly 
because one is overwhelmed with C++ constructor introductions. Thus, my 
question: does any of you C++ gurus now where this thing is defined and what I 
have to do (or not to do) in order to use it?

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinralbre...@jabber.ccc.de

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to