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 » Doubt about container
Re: Doubt about container [message #52494 is a reply to message #52493] Thu, 10 October 2019 08:49 Go to previous message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Laughing Laughing

The examples must be simple, but the simplicity of the examples should not be misunderstood.

As I expected, the answer was terribly easy: Ptr. From Reference/Ptr:

struct Foo : Pte<Foo> {String text;};

CONSOLE_APP_MAIN {
	Ptr<Foo> ptr;
	{
		Foo foo;
		foo.text = "Text";
		ptr = &foo;
		Cout() << (void*)~ptr << " -> " << ptr->text << "\n";
	}
	Cout() << (void*)~ptr << "\n"; // foo was destroyed but this is totally valid, as ptr == 0
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Previous Topic: BETA status handling
Next Topic: S_type and ValueMap
Goto Forum:
  


Current Time: Sat Apr 27 21:51:38 CEST 2024

Total time taken to generate the page: 0.05293 seconds