« first day (2921 days earlier)      last day (2033 days later) » 

12:00 AM
So, i've been noticing this pattern often. You have have some cavernous function that takes a const reference, for example doWork(const settings& setting), then somewhere in it has a callback which changes the const settings& setting. Whats the correct solution, maybe split the function up? Maybe don't use a reference...
or maybe don't use const :-)
 
But first, need to sort out videos from drone and underwater cam
 
12:15 AM
Also, was there some wacky thing that happens when smart pointers try to delete incomplete types? Like the type information needs to be visible in the compilation unit where the destructor is created? Was there some boost library that checked that you weren't deleting/free an incomplete type?
 
There was. std::unique_ptr<T> calls delete. delete must know if there's a destructor to call. Though, fairly sure std::unique_ptr<T> makes that a hard error instead of UB
 
Yeah, I got bit by that a few times in MSVC, where the compiler omitted the delete because it was an incomplete type. Would be nice if there was some way to choke compilation on delete and an incomplete type.
Curious if there is a way to force generation of a default destructor in another compilation unit, where the type is known.
 
Pretty sure last time I used a unique_ptr on an incomplete type it just refused to compile
 
unique_ptr on an incomplete type should be fine...
 
> Although std::unique_ptr<T> with the default deleter may be constructed with incomplete type T, the type T must be complete at the point of code where the destructor is called.
"the destructor" here refers to the destructor of std::unique_ptr<T>
Doesn't say whether it's a hard error or not, but that's trivial to diagnose, so I expect the implementations to issue errors here as a matter of QoI
 
12:28 AM
So, it seems the paradigmatic solution is to define a custom destructor, in a different header, which,in retrospect, seems rather harmless.
I feel really, dirty, this is the first time I've used a shared_pointer in a year :-)
 
oh btw
std::shared_ptr has a similar restriction, but not on the destructor, but on constructor instead
 
Yeah, I think thats where I got messed up a few years ago, because obviously, the compiler needs to know how to destroy the object.
 
(deleter is type erased, so the actual deleter is accessed during construction time to get its address, due to templated constructor)
incomplete types cause a lot of C++ abstractions to leak
 
12:33 AM
you can't delete an incomplete type, or perhaps the compiler can't delete an incomplete type
also on -O3 the compiler omit all the code :-)
 
that's because there's no delete call there
the pointer is null
 
You're right, but I think the standard explicitly says deleting an incomplete type is UB. stackoverflow.com/a/2517455/314290
 
> Unlike std::unique_ptr, the deleter of std::shared_ptr is invoked even if the managed pointer is null.
wait what
 
12:49 AM
@Mikhail indeed, to help with that std::default_delete<T> is required to crap out if T is incomplete
 
So, none of the compilers are choking on the toy example, I linked at the top...
 
std::shared_ptr does not use std::default_delete
 
1:14 AM
more food for thought, plugging in a deleter into std::unique_ptr to be closer (though not equivalent) to std::shared_ptr
forgive the cheeky std::integral_constant abuse, it’s to be topical cc @sehe
 
 
2 hours later…
3:07 AM
Be ready to uninstall te parts a few times, to have that little sqare base fitting correctly with all the other sections. Also have a saw and some super glue ready. Lol.
Such a great review, gives so much 'confidence' to assemble my flat pack robots ...
 
 
2 hours later…
5:23 AM
Before:
Now:
Peeps, are you ready for my Nth company 'DIY flatpack A.I. robots'?! </Trollololo>
That's it for my time for flatpack robots today, there are many many other things I need to work on ....
 
 
7 hours later…
12:35 PM
Making a youtube video with clips I have taken on my drone and underwater cam.
Need to learn iMovie. Another precious hour that I will never get back ...
 
nwp
12:58 PM
> C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/as.exe: debug\scriptengine.o: too many sections (40371)
{standard input}: Assembler messages:
{standard input}: Fatal error: can't write debug\scriptengine.o: File too big
Such joy.
 
@nwp 32bit compile on a x64 system?
IIRC both firefox and chrome had to go to x64 tool chains even for their 32bit builds
 
nwp
1:37 PM
@Mgetz Yes. Blame Sol2.
There is supposed to be a workaround with -Wa,-mbig-obj which didn't help.
If only we could spare the 7GB to install Qt 5.12.
 
At least that's smaller than the 40GB that Chromium requires to build itself.
 
nwp
That's not for the build, that is binaries + docs only. I think.
To be honest I'm not entirely sure what the Qt Maintenance tool actually does.
 
 
2 hours later…
nwp
3:14 PM
> SUMMARY: ThreadSanitizer: data race (/usr/lib/x86_64-linux-gnu/libtsan.so.0+0x2c699) in pthread_mutex_destroy
I hope there is an actual race with a mutex being used while concurrently being destroyed and TSan not simply being dumb.
 
3:48 PM
0
Q: Deadlock when using std::async with future as member

guitarflowI transferred our app from Objective-C and Cocoa to C++. In Objective-C I was frequently using Grand Central Dispatch and the very handy dispatch_async functions. When moving to C++11, I found std::async as the closest equivalent. I'm using Scott Meyers variant of it which makes sure it's really...

 
4:05 PM
 
4:48 PM
I disagree with the always return thing, what about [[unreachable]] instead on the places where you cant actually fall off the end?
 
 
6 hours later…
11:13 PM
The folks at Qt started working on a 3 year old bug I submitted: bugreports.qt.io/browse/QTBUG-44056 . Its a miracle.
 
11:24 PM
That's probably a good indication of how important the bug you have reported is ...
 
Cool.
 
Perhaps one day, they're going to realize that having 3 ways to layout a UI (programmatically like Fusion, via the pusedo CSS settings, or via XML) was a terrible design decision. Or maybe the mistake is using Qt Widgets rather than the other thing (QtQuick?). For example, I can't solve my issue with title boxes being draw when there is no title, as the values are hard coded into the "fusion" theme. So I'd need to rebuild the Qt dlls to fix the problem.
 

« first day (2921 days earlier)      last day (2033 days later) »