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 » Community » Newbie corner » Value strange behaviour result in ValueTypeError
Re: Value strange behaviour result in ValueTypeError [message #51796 is a reply to message #51791] Fri, 31 May 2019 23:30 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1430
Registered: December 2006
Ultimate Contributor
Your code is throwing an exception.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7a42535 in __GI_abort () at abort.c:79
#2  0x00007ffff7e0b642 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7e17186 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff7e171d1 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff7e17405 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00005555556109c4 in Upp::Value::GetSmall<long long> (this=0x7ffff7fc85b0) at /home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Value.hpp:209
#7  0x00005555555ae241 in Upp::Value::GetOtherBool (this=0x7ffff7fc85b0) at /home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Value.cpp:203
#8  0x000055555556ca7e in Upp::Value::operator bool (this=0x7ffff7fc85b0) at /home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Value.h:221
#9  0x000055555556d1ed in testAddVector<Upp::String> (keyname=..., t=...)
    at /home/ssg/dvlp/cpp/sergey/upp/ValueStrangeBehaviour/ValueStrangeBehaviour.cpp:7
#10 0x000055555556be96 in ConsoleMainFn_ () at /home/ssg/dvlp/cpp/sergey/upp/ValueStrangeBehaviour/ValueStrangeBehaviour.cpp:17
#11 0x000055555558d2dd in Upp::AppExecute__ (app=0x55555556bc76 <ConsoleMainFn_()>) at /home/ssg/dvlp/cpp/upp/git/uppsrc/Core/App.cpp:343
#12 0x000055555556bc69 in main (argc=1, argv=0x7fffffffdf18, envptr=0x7fffffffdf28)
    at /home/ssg/dvlp/cpp/sergey/upp/ValueStrangeBehaviour/ValueStrangeBehaviour.cpp:12


This is happening in this statement:
if(ConfigurationType.Add()) //Add t to value

because you are adding a String, which will be returned by the method Add(), and you are trying to implicitly convert Value, containing this string, to bool in the if() statement.
Such conversion is impossible. This is why you are getting an exception.


Regards,
Novo
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Memory leaks ?
Next Topic: Tricky template non-typeParameter
Goto Forum:
  


Current Time: Sat Jul 05 04:12:43 CEST 2025

Total time taken to generate the page: 0.03083 seconds