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 » FileIn and Buffer cannot be composed in a class?
FileIn and Buffer cannot be composed in a class? [message #56555] Thu, 25 March 2021 05:20 Go to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 219
Registered: June 2011
Experienced Member
If I try to put either in a class I cannot use move constructors, copy constructors, etc on an enclosing class because they are implicitly deleted by these two. What's the workaround?
Re: FileIn and Buffer cannot be composed in a class? [message #56556 is a reply to message #56555] Thu, 25 March 2021 05:29 Go to previous messageGo to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 219
Registered: June 2011
Experienced Member
I was wrong about Buffer, that works with a move constructor. Still, FileIn and all of its dependencies down to Stream do not.
Re: FileIn and Buffer cannot be composed in a class? [message #56558 is a reply to message #56555] Thu, 25 March 2021 10:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello jjacksonRIAB,

You can use One<FileIn> for FileIn (or for anything), if you need to move it.

e.g.

struct Foo {
	One<FileIn> fin;
	Foo() { fin.Create(); }
};

CONSOLE_APP_MAIN
{
	StdLogSetup(LOG_COUT);
	Foo foo;
	Foo f = pick(foo);
	RDUMP(f.fin.IsEmpty());
	
}



Should return "false". Smile

Best regards,
Obilvion


[Updated on: Thu, 25 March 2021 10:14]

Report message to a moderator

Re: FileIn and Buffer cannot be composed in a class? [message #56561 is a reply to message #56558] Thu, 25 March 2021 14:09 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 219
Registered: June 2011
Experienced Member
Thanks, Oblivion, that's what I ended up doing.
Previous Topic: Pass data of Vector<Vector<double>> into a function call
Next Topic: How to make this looking EditString UI
Goto Forum:
  


Current Time: Thu Mar 28 09:55:28 CET 2024

Total time taken to generate the page: 0.02573 seconds