Click here to Skip to main content
15,890,690 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Mobile app ads Pin
Nelek10-Dec-20 8:07
protectorNelek10-Dec-20 8:07 
GeneralRe: Mobile app ads Pin
Randor 10-Dec-20 8:24
professional Randor 10-Dec-20 8:24 
QuestionRe: Mobile app ads Pin
David Crow10-Dec-20 9:16
David Crow10-Dec-20 9:16 
AnswerRe: Mobile app ads Pin
Randor 10-Dec-20 9:58
professional Randor 10-Dec-20 9:58 
AnswerRe: Mobile app ads Pin
dandy7210-Dec-20 8:31
dandy7210-Dec-20 8:31 
GeneralRe: Mobile app ads Pin
#realJSOP10-Dec-20 23:34
mve#realJSOP10-Dec-20 23:34 
AnswerRe: Mobile app ads Pin
Kaladin10-Dec-20 8:42
Kaladin10-Dec-20 8:42 
RantSTL is supposed to make things *easier* not harder Pin
honey the codewitch10-Dec-20 4:41
mvahoney the codewitch10-Dec-20 4:41 
I'm writing a little bit of code to represent modest in memory JSON trees on 32-bit Arduino compliant platforms using the Arduino SDK.

My first plan was to at least prototype that using something like std::unordered_map but lo and behold, you can't use unordered_map with incomplete types. With GCC's std::map you can, for some dumb reason. It's totally possible to implement unordered_map to work with incomplete types, and boost even does it, but I can't use the boost framework with this thing.

Consider what a structure representing JSON "object" actually is:

It's an unordered hashtable with string keys, that point to a union of possible types, one of which is an unordered hashtable with string keys that point to a union of possible types, one of which is an unordered... you get the idea.

Basically the map needs to have itself as right hand side members. This is pretty standard for representing JSON in any language.

This is also fairly commonplace for representing tree structures.

So it just floors me that neither Microsoft nor the GCC team have implemented unordered_map in a way that's (at least I consider to be) proper. This use case is so common!

I can kluge around it supposedly with std::unique_ptr but I'm running into more problems there.

At this point I'm about ready to write my own.

Normally I *love* the Standard Template Library. It's the perfect addition to bring C++ from a mid level language to a (slightly) higher level language, and it's nice that so much of the guts are able to be reconfigured and overridden but when it fails, it fails *spectacularly* and then you are as much on your own as when you try to do something in classic VB outside of its ecosystem. It's a really frustrating thing about an otherwise lovely framework.
Real programmers use butterflies

GeneralRe: STL is supposed to make things *easier* not harder Pin
Randor 10-Dec-20 5:21
professional Randor 10-Dec-20 5:21 
GeneralRe: STL is supposed to make things *easier* not harder Pin
honey the codewitch10-Dec-20 5:28
mvahoney the codewitch10-Dec-20 5:28 
GeneralRe: STL is supposed to make things *easier* not harder Pin
Randor 10-Dec-20 5:42
professional Randor 10-Dec-20 5:42 
GeneralRe: STL is supposed to make things *easier* not harder Pin
honey the codewitch10-Dec-20 5:52
mvahoney the codewitch10-Dec-20 5:52 
GeneralRe: STL is supposed to make things *easier* not harder Pin
Gerry Schmitz10-Dec-20 5:27
mveGerry Schmitz10-Dec-20 5:27 
GeneralRe: STL is supposed to make things *easier* not harder Pin
honey the codewitch10-Dec-20 5:28
mvahoney the codewitch10-Dec-20 5:28 
GeneralRe: STL is supposed to make things *easier* not harder Pin
#realJSOP10-Dec-20 23:36
mve#realJSOP10-Dec-20 23:36 
GeneralRe: STL is supposed to make things *easier* not harder Pin
honey the codewitch11-Dec-20 1:25
mvahoney the codewitch11-Dec-20 1:25 
GeneralThought of the Day Pin
OriginalGriff10-Dec-20 4:30
mveOriginalGriff10-Dec-20 4:30 
GeneralRe: Thought of the Day Pin
Johnny J.10-Dec-20 4:32
professionalJohnny J.10-Dec-20 4:32 
GeneralRe: Thought of the Day Pin
W Balboos, GHB10-Dec-20 5:20
W Balboos, GHB10-Dec-20 5:20 
GeneralRe: Thought of the Day Pin
jeron110-Dec-20 5:47
jeron110-Dec-20 5:47 
GeneralRe: Thought of the Day Pin
W Balboos, GHB10-Dec-20 6:58
W Balboos, GHB10-Dec-20 6:58 
GeneralRe: Thought of the Day Pin
jeron110-Dec-20 7:11
jeron110-Dec-20 7:11 
GeneralRe: Thought of the Day Pin
W Balboos, GHB10-Dec-20 7:13
W Balboos, GHB10-Dec-20 7:13 
GeneralRe: Thought of the Day Pin
jeron110-Dec-20 7:55
jeron110-Dec-20 7:55 
GeneralRe: Thought of the Day Pin
W Balboos, GHB10-Dec-20 7:58
W Balboos, GHB10-Dec-20 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.