[C++-sig] Re: return_self_policy / return_arg

Nikolay Mladenov nickm at sitius.com
Sat Jun 28 01:49:27 CEST 2003


And again ...

PS. How can I get you to commit the pathes I posted some time ago about
keywords?

David Abrahams wrote:
> 
> Very nice.  Just a couple nits:
> 
> Nikolay Mladenov <nickm at sitius.com> writes:
> 
>     >>> from return_self import *
>     >>> l1=Label()
>     >>> l1 is l1.label("bar")
>     1
>     >>> l1 is l1.label("bar").sensitive(0)
>     1
>     >>> l1.label("foo").sensitive(0) is l1.sensitive(1).label("bar")
>     1
>     >>> return_arg is return_arg(return_arg)
>     1
> 
> These tests will break when we get bool in Python 2.3.  I use assert
> instead.
> 
> > namespace boost { namespace python
> > {
> >     namespace detail
> >     {
> >         template <std::size_t>
> >             struct return_arg_policy_pos_argument_must_be_greater_than_zero
> > # if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__)
> >         {error}
>            ^^^^^
> This will produce an error a little bit too early ;-)
> I think you'd better delete it.
> > # endif
> >         ;
> >
> 
> Once these fixes have been made, anyone with CVS write permission can
> commit it as far as I'm concerned, or you can remind me when I come
> back from vacation.
> 
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
-------------- next part --------------
'''
>>> from return_self import *
>>> l1=Label()
>>> assert l1 is l1.label("bar")
>>> assert l1 is l1.label("bar").sensitive(0)
>>> assert l1.label("foo").sensitive(0) is l1.sensitive(1).label("bar")
>>> assert return_arg is return_arg(return_arg)

'''

def run(args = None):
    import sys
    import doctest

    if args is not None:
        sys.argv = args
    return doctest.testmod(sys.modules.get(__name__))
    
if __name__ == '__main__':
    print "running..."
    import sys
    sys.exit(run()[0])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: return_self.cpp
Type: application/x-unknown-content-type-cppfile
Size: 1400 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030627/a18960ab/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030627/a18960ab/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: return_self_policy.hpp
Type: application/x-unknown-content-type-hppfile
Size: 2533 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030627/a18960ab/attachment-0001.bin>


More information about the Cplusplus-sig mailing list