RE: From Python to c++

2006-03-22 Thread Ames Andreas
Hello Marco, > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > g] On Behalf Of Marco Aschwanden > Sent: Tuesday, March 21, 2006 8:43 PM > Subject: From Python to c++ > > parsed = { > "name":["Mac", "Mike"], > "age":[25, 55], > "place":["Zurich", "Oslo"]

Re: From Python to c++

2006-03-22 Thread Marco Aschwanden
Heck! I received 1 useless answer in comp.lang.c++ and here I get useful links/hints and even a code-pattern! Great. Thank you all. Sorry for posting a c++-problem here, but it was derived from my thinking the Python way... Cheers, Marco -- http://mail.python.org/mailman/listinfo/python-li

Re: From Python to c++

2006-03-22 Thread Marco Aschwanden
On Wed, 22 Mar 2006 08:11:24 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > This is so scary, I probably shouldn't post this. It sounds from your > description, you really want RTTI. I haven't done this in a long > while, so I'm not sure there is an easier way. But the program below >

Re: From Python to c++

2006-03-21 Thread [EMAIL PROTECTED]
Marco Aschwanden wrote: > This is actually a c++ problem. Got no satisfying answer on comp.lang.c++. > Maybe you can help better because I know, there are many c++-converts ;). > > Suppose you've got the following list (first line has field names, second > line has types and any row after is data):

Re: From Python to c++

2006-03-21 Thread Gonzalo Monzón
Hi Marco! Perhaps the simpler way could be to store them all in the map as string data, but of course, it depends on what you must do later with that data, so you can save the field types and convert from string when needed to use any value... if you do not need to process later that data at a

Re: From Python to c++

2006-03-21 Thread Farshid Lashkari
> Any suggestions are very welcome! Are you allowed to use any boost libraries? If so then boost::any would probably help. The boost::any object can contain any object type. So you could have a single container that looked like the following: std::map< std::string, std::vector > result; Since

Re: From Python to c++

2006-03-21 Thread Roman Yakovenko
On 3/21/06, Marco Aschwanden <[EMAIL PROTECTED]> wrote: > Any suggestions are very welcome! > > > Regards, > Marco (Forced to code in c++ again let me estimate the simplicity of > python) C++ is also simple, if you have right library to do the job: http://boost.org/doc/html/variant.html http://bo