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 » Assert failed in core/value.h line 464
Re: Assert failed in core/value.h line 464 [message #28259 is a reply to message #28243] Wed, 25 August 2010 11:35 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3437
Registered: August 2008
Senior Veteran
Hello Jerson

I do not understand well your problem. However I will put some ideas:

This code gives compiling errors because it does not know in advance the type of val:
Value val = 35;
double res = val/2;

This one works:
Value val = 35;
double res = int(val)/2.;

This one works too:
Value val = 35;
double res = double(val)/2.;

But this one will fail in runtime with an Assertion:
Value val = "35";
double res = double(val)/2.;

If you want to avoid an Assertion but your code could put an inappropriate value in Value, you can do this:
Value val = "35";
double res;
if (IsNumber(val))
	res = int(val)/2.;
else
	res  = -1;	// You can put here and exception, an Exclamation, a return false, ...



Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Algorithms and Vectors
Next Topic: Passing Vectors as arguments of functions.
Goto Forum:
  


Current Time: Sat Jun 21 23:48:10 CEST 2025

Total time taken to generate the page: 0.12053 seconds