From Objective C to C++ typing headache From Objective C to C++ typing headache json json

From Objective C to C++ typing headache


First of all a disclaimer, when I talk about Objective C here I really include a lot of Cocoa I think that most readers will seamlessly read this into it, but just to be clear when I talk about Cocoa specific stuff calling it Objective C it's just that I am really used to using Cocoa along with Objective C (i.e. OSX development).

Well I've got some input and the solution I am probably going with here is to adept to Boost. So this would mean that I parse my json dictionaries as std::map <std::string, boost::any> and my arrays/vectors as std::vector <boost::any> and this will loosen up the hard typing to a level which is more fitting for a data description format such as json.

Thanks to all the people commenting and helping out here!

The great thing is that even if this is for my json-parser it really have given me more perspective so I feel that there are similar problems I've experienced from being spoiled in coding in languages which are less strongly typed, and have a more open (or closed I guess depending on how you see it) object architecture. Hope that others will find this question useful as well!