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 » U++ Library support » U++ Core » The problem with 'Null'
Re: The problem with 'Null' [message #20467 is a reply to message #20452] Fri, 20 March 2009 08:16 Go to previous messageGo to previous message
gridem is currently offline  gridem
Messages: 45
Registered: August 2008
Member
Thank you very much for detailed answers! It's very useful for me to understanding intrinsics of Upp.

But let's me to understand my opinion. I think that Null approach is not narrow-minded but generic. It uses for Value, it uses for many simple types.

Because I use a lot the templates, overloaded functions and code generation I have to utilize the generic methods for every types that I want to use. And I use Null as some kind of parameter state that I can treat as:
1. Init/Non init
2. Error on function return.
3. Default values to call the function to distinguish it from nondefault values:
void some_fun(int a, int b = Null, bool c = Null, ...)
{
  if (b == Null)
    b = some_complex_calculated_value(a);
  ...
}

etc

So to see this approach for String's and Vector's I have to do workaround. May be I should not use the generics but another mechanism?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: In some cases CParser can be out of buffer
Next Topic: Possible bug/clarification only callback2 was changed for const Object*
Goto Forum:
  


Current Time: Sun Jul 13 17:25:39 CEST 2025

Total time taken to generate the page: 0.04391 seconds