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 » Coffee corner » About Nuller and Null
Re: About Nuller and Null [message #55103 is a reply to message #55102] Sun, 11 October 2020 11:22 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
Tom1 wrote on Sun, 11 October 2020 10:34


Please note that this can return real references, if T is a reference.



Well, Null is about "value null", or "empty value". Definitely was not meant to be used with NULL references or pointers...

If you insist on returning a reference to something and you want to use Null value as error, you can always do something like

const Foo& GetData(...)
{
    static Foo null_data = Null;
...
    if(error) return null_data;
...
}


I mean, instead of inventing something to contain NULL reference, just return a reference to Null value...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Architectural and C++/Upp questions
Next Topic: Sins of the past: The very first link to UPP website in the official arstechnica article
Goto Forum:
  


Current Time: Thu Aug 28 15:43:09 CEST 2025

Total time taken to generate the page: 0.06855 seconds