« first day (1452 days earlier)      last day (1384 days later) » 

10:02 AM
hey guys, quick question, I've got a class that looks like this, any idea how to make the double template pack parameter work ?

template<typename ...events_t, uint32_t ...stackDepth>
class Module {
protected:
std::tuple<FFS::EventHandler<events_t, stackDepth>...> evtHandlers;
 
 
1 hour later…
11:19 AM
@Magix AFAIK you can't
 
you could put both into their own tuple-like wrapper
 
and you broke oneboxing
 
what's oneboxing
 
2
Q: double template parameter pack

MagixHere is what my class looks like : template<typename ...events_t, std::uint32_t ...stackDepth> class Module { protected: std::tuple<EventHandler<events_t, stackDepth>...> evtHandlers; // ... } I am constrained to give the EventHandler a pair of template arguments, one being the handled e...

 
oh. sorry \o/
 
 
2 hours later…
1:52 PM
Hello guys, I need a short approach for the following use case: With my application, data is transferred from a sensor. After the transfer is complete, the user can decide whether to save the data. If so, he can choose a path and file name where the data will be saved. However, this means that the data must be temporarily stored in a container or something during the transfer. How could you do that?
 
Store it in memory if it's small enough, store it in a temp folder if it's not small enough
 
So you think that the data should still be saved in a file on the PC, in my case in the temp folder, since the data is large? And if the user does not want this, the file is deleted and if he does want the data, then this file is moved to the path that the user has specified and then the file name changed accordingly?
 
2:13 PM
@SpaceToon That's pretty much standard practice, it also helps guard against power loss
 
 
2 hours later…
4:24 PM
Is the following enough to safely read from file in a binary mode?

1. Open the file, check `file.open()`
2. Ensure there is enough buffer space in memory
3. `file.read(buffer, length)`
4. check `if (file)`

Order of points 3 and 4 bothers me the most, as well as whether point 4 should check for `file.good()` or `file.operator bool()`
I understand that file.operator bool() differs from file.good() in that the former allows end-of-file to be set. Is that a condition that is only set after the required amount of data has been read from the file?
 
4:43 PM
Also, what does the following mean, precisely:

The unformatted input functions basic_istream::read, basic_istream::get, basic_istream::peek, and basic_istream::getline, when reaching the end of the stream.
If a given file contains 10 bytes, and I have read 10 bytes, have I "reached end of stream"? If I try to read 11 bytes?
 
4:54 PM
@iksemyonov just use operator bool() unless you have a good reason not to
 
@Mgetz When I try to read past the file end, I think operator bool() not signal?
 
@iksemyonov it should
 
?
When eofbit is set, operator bool() still returns true
 
when you go past the end you'll get a fail bit
> basic_istream::read, if the end-of-file condition occurs on the input stream before all requested characters could be extracted.
 
OK, I see that line now, too. What does this mean, then:

> The unformatted input functions basic_istream::read, basic_istream::get, basic_istream::peek, and basic_istream::getline, when reaching the end of the stream.
 
5:00 PM
 
I am :)
My quote above comes from that page, section eofbit.
 
eof bit is not really what you want to use?
it's quirky for what most people think it's for
it's literally easier to use operator bool() is 98% of cases
 
It's not that I want to use it, I just want to understand the wording
 
@iksemyonov it's exactly what it says... if they are positioned at the end of the stream the eof bit is set
 
@Mgetz I can't reproduce it locally, that's the thing
As in, after every read, I test for eof(). I surely am reading out the complete file. I make sure I do by using tellg() and comparing its output to that of stat.
And after the last read, ,eof() returns false.
Is that a part of the 'quirkiness'?
 
5:07 PM
@iksemyonov yes
 
I can only receive and eof() upon manually reading past the enf-of-file, but that's not what it reads on the box, sort of.
 
5:35 PM
Hello
In MASM macros, can we use registers or memory locations as arguments?
 
5:48 PM
no idea, I'd suggest asking on the site or looking in documentation
 
@Mgetz which site?
 
I think asking must be technical-related? The button says "report a problem"
 
@Hammad Oh I thought you were asking about documentation
By site I meant stackoverflow
 
6:03 PM
@Mgetz :) ok. Anyway, I already contacted the author of my book. I prefer waiting till he replies.
 

« first day (1452 days earlier)      last day (1384 days later) »