Boost logo

Boost :

Subject: Re: [boost] [python] extracting a string and a one-length list containing a string
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-03-12 06:35:48


At Thu, 10 Mar 2011 09:33:27 +1100,
Allan Johns wrote:
>
> Hello,
>
> Given a boost::python object, how can I the difference between that object
> containing a string, or a sequence of length 1 whos zeroeth element is a
> string? Ie:
>
> "foo" --vs-- ["foo"]
>
> bp::extract<std::string> succeeds in both cases.

I'm shocked. Really? Can you show the code?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk