Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » ASSERT when using ValueMap
Re: ASSERT when using ValueMap [message #47700 is a reply to message #47699] Tue, 07 March 2017 15:00 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
NilaT wrote on Tue, 07 March 2017 14:54
Sorry for being too dumb to fix a 'trivial' error.


Ah, you misunderstood and that makes me sound like I am ranting...

Error was 'borderline' - by that I mean that it was very unusual usage (there reading docs would help). Anyway, I decided it should work even if used that atypical way, so had to fix that. It was not anything you were supposed to fix, that was my task.

It looked 'trivial' to fix at first, but things were more complicated than I anticipated.

What you did 'wrong' is that you have used RawToValue and ValueTo without reason and perhaps without complete understanding what they mean...

Params params = HandleParams(param1, param2); // Params is a struct which contains some Strings, some ints, and a Time Variable
ValueMap result;
result.Add("key1", params.someVar);


ValueMap map = rpc["params"]; // rpc = RpcData type
int x = map["someKey"];


would have worked (I supposed someVar is String or int or something like that).

Mirek

[Updated on: Tue, 07 March 2017 15:03]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: C2280
Next Topic: Use zlib inside another library
Goto Forum:
  


Current Time: Sun May 12 01:48:37 CEST 2024

Total time taken to generate the page: 0.02651 seconds