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 » U++ community news and announcements » MakeOne
Re: MakeOne [message #47650 is a reply to message #47649] Tue, 21 February 2017 16:05 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
Klugier wrote on Tue, 21 February 2017 12:14
Hello,

I have got one question. Will it work with auto?

auto stream = MakeOne<FileIn>(fn); // Is auot MakeOne or One?




Sure. It will be MakeOne, but that hardly matters.

	{
		auto in = MakeOne<FileIn>(GetDataFile("Console.cpp"));
		One<Stream> s = pick(in);
		while(!s->IsEof())
			DDUMP(s->GetLine());
	}


Quote:

Why not make MakeOne function rather than class?


Class seems to be more versatile here - you can use it just like function, but you can declare the variable too.

E.g. you can do this:

One<Stream> OpenFile()
{
    MakeOne<FileIn> in;
    in->Open("asd");
    return in;
}


With "function only" you would have to type a bit more...

Mirek

[Updated on: Tue, 21 February 2017 16:07]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Pdf signing
Next Topic: New verion of msbt2017 openssl library for win32
Goto Forum:
  


Current Time: Fri May 10 07:50:34 CEST 2024

Total time taken to generate the page: 0.01627 seconds