« first day (3384 days earlier)      last day (1546 days later) » 

12:39 AM
Conclusions: Due to the increase in avocado cutting injuries and the severity of these injuries, more systematic surveillance is needed as well as improved safety measures.
In conclusion, my research shows you should keep paying me to do it.
 
1:02 AM
does anyone know what's the bracket doing after each member variable in this struct declaration?
struct LogMacroData {
std::string_view file {};
std::string_view function {};
std::string_view fmt_str {};
int32_t line {};
Level level {};
};
I'm not even sure what version of C++ this is.
 
Its value initialization, personal I suspect the file you see is due to somebodies statistic analysis tool yelling at them.
In this case, the member line is initialized to 0, while the string_views, I think would stay the same.
Personally, I don't like having "reasonable" defaults like line being zero because line=0 means unitialized or actually the line is zero...
 
cool thank you!
I was trying to find this syntax information but not even cppreference has it https://en.cppreference.com/w/c/language/struct
or maybe I might've missed it
 
Also line is an int32_t which is really pretentious because it uses both a fancy type (rather than int) but also is wrong because lines shouldn't be negative :-)
Also one wonders what happens when the string attached to the stringview exceeds the life cycle of the LogMacroData
 
 
2 hours later…
3:01 AM
How do you remember to include needed headers (when they are nearly always already included by other headers) when using some common used stuffs? Or does anybody ever include them (unless complained by the compiler)?
 
3:22 AM
for example, in gcc, simply by including <string>, a lot of headers are already included: coliru.stacked-crooked.com/a/1b24dfaeb294c57a
Does anybody ever remember to #include <utility> when writing std::move?
 
3:43 AM
Don't include more than you need. So if some other header includes <utility> you should not include <include>, if you use gcc check out "include what you use"
 
4:12 AM
@drerD It's called "uniform initialization" -> softwareengineering.stackexchange.com/questions/133688/…
Does anyone have a good starting reference on implementing type traits in C++?
 
 
2 hours later…
5:49 AM
You mean strong types? Strong types in C++ are too annoying to implement. Most traits for built in types are already implemented.
 
6:39 AM
Don't really care on the "too annoying" part, I'm more just trying to find some decent examples of metaprogramming that I can learn from that aren't extraordinarily weird, but aren't super basic, either. There is the type traits stuff in std lib which tells you info about basic types, but you can also create traits yourself, for like interfaces. As you would in say, Rust. I'm not sure if that meets what you mean by "strong types".
 
Strong types are a different thing. Anyways, you can look at the stuff here: akrzemi1.wordpress.com/2017/12/02/your-own-type-predicate
 
Indeed. And thanks, that is exactly the type of thing I was looking for!
 
 
2 hours later…
9:12 AM
I'm hungry
 
nwp
Ban the first person who says "hi hungry".
 
Hello Hungry, we have met again ;)
 
nwp
🔨
 
I'm gonna fetch a coffee and a pain au chocolat
 
nwp
9:17 AM
Is that what French call anal?
 
user7659542
9:28 AM
What s your favorite type of pain?
 
user7659542
pain au chocolat
 
x)
I've got a tank top with that written on ^
I need to order one again though, it's all worn out
But it's kind of a signature tank top now, so I really want one again
 
is this some weird bug on my side or did SO add a Qt icon next to the [c] tag? i.imgur.com/WOVevVY.png
 
no you're right
an ugly one at that
 
user6461957
10:03 AM
Alright this is a weird request, but can I get a kick/ban until March? I need to focus on my exams RN, but I am constantly checking on this chat.
And it's hard to control my impulses... :/
 
user6461957
Welp, I guess no... :/
 
nwp
Stay with us for a little while longer, fail your exams, become unemployable and stay with us forever for another 4 months before SO shuts down chat.
3
 
just nobody tell them they have chat, everyone that knew it existed is probably gone by now
 
@d03 be glad it's not nearly as active as it used to be x)
 
11:17 AM
@nwp Don't think SO will shut the chats down. This website wants to mining all your data to find all the evidence of your criminal activities.
 
nwp
Joke's on you, I commit my crimes elsewhere.
 
The more you chat, the more they can tell, so keep on talking ...
 
then they can just make a bot that replaces you when you leave
 
I commit my crimes to master
 
Anyone branch your crimes?
 
11:32 AM
Real moral is always use O3
 
 
2 hours later…
1:34 PM
Beer, rosé & coffee
Now I'm ready to work again
 
@Morwenn Europe: This is acceptable, US: YOU'RE FIRED!!!
 
Really?
I was with my grand-mother it's all good
 
Talking about fired ... or retrenchment, I don't really get this gofundme thing for shog. Sure, it would be like a proof of how much people on stackoverflow love him or maybe even kind of like a tip from satisfied customers (this is a bit stretched). But hey, he is a white guy in 30s-40s. I am not being sexist or racist. But this fund raising is almost like saying shog could not find a better job after stackoverflow and would need donation to get through financially. It's insulting in a way.
Stackoverflow and it's weird fund raising things.
Maybe I am not the most charitable person on the planet, but I did donate to bushfire rescued horses in the past 2 months. I find those are valid reasons for such fund raising.
 
Hey, I do agree with you
 
Haven't seen that page, but sure does seem a little weird. At the same time you could also say "well Australia is a developed nation, why not give to more needy developing nations". I guess you could see it more as a sign of sympathy.
 
1:46 PM
@PeterT Donation to needy developing countries is usually a way to control them.
BTW, Americans are definitely more charitable than tight a$$ Australian or Chinese. Although a lot of the times, I wonder they think about whether the cause for their donation is valid.
 
yes it is, it's also often hard for money to do lasting change there because of missing infrastructure and corruption, but none of that really has anything to do with my original point.
 
More like WHY DO YOU STILL TRY TO SELL TO MUCH FUCKING COAL WHAT'S THE POINT WITH HELPING IF YOU'RE STILL DOING THAT AAAAAAAAAAHHHHHHH
 
Umm electricity feed in price has dropped, solar farm may not be profit. So kind of start thinking whether the project should go on. You can't get clear energy cheap (unless your country pays for the difference, which it doesn't for commercial scale solar farm).
 
yes, the whole premise of switching to "green" everything is that in the first place the population will need to make an effort and say bye to some things, but that if everything is done socially it shouldn't weight too much more on the poor than the current situation
 
1:55 PM
Current government is called Coalition. Guess which industry is one of its biggest sponsors?
The problem is that, maybe only small percentage of population on the face of earth is considered 'rich'. But the most rich would not invest in anything that's not profitable. All developed countries have their own budget to balance, and reluctant to fund renewable energy.
So logically, we are doomed.
 
Meanwhile one guy alone here has 4% of the GDP
Global capitalism was a mistake
 
Make that guy invest heaps on renewable energy >_<
 
You wish
Plus even if he did that and that France became an example it's all that it would be: an example
At the European level it would be better if he used his money to replace the coal plants in Poland
 
user7659542
2:12 PM
if inline is a mere suggestion to the compiler. What prohibits you from putting inline in front of every function?
 
Nowadays inline is used to mean that the same function can be declared several times in the same translation unit as long as all of the declarations are equivalent
Basically it allows you to put functions in a header file without risking multiple definition issues
It's almost never used as a hint to the compiler to inline the function, but it means that the compiler will always see the code in the function, and thus will be able to inline it better if it decides it's a good idea
 
@traducerad What @Morwenn said but also work and code bloat. The compiler has to prove that any two functions are the same then and it basically makes linking an absolute nightmare. It can also make debugging insane.
 
user7659542
@Morwenn Whut? Never heard about that
 
user7659542
Is this only for cpp or for C as well
 
C99 inline is a bit different but I'm not sure how it works exactly
Something about linkage I guess?
 
user7659542
2:17 PM
idk, only knew about the inlining stuff in order to not have the "jumping cost"
 
user7659542
not about having multiple function definitions
 
It's because it's originally a bit linked: if you want the compiler to properly inline the code you need to make sure that the compiler "sees" the code, which means that it needs to be able to see the code as text and not only the compiled functions (I'm simplifying)
One way to achieve that is to put the function in the header, since headers are always available as text
 
user7659542
@Morwenn the function in the header = its definition in the header?
 
@traducerad so that can be removed by the linker anyway
 
However headers might be included several times and the compiler will recompile the same functions with the same names, however you're not allowed to have several definitions of a same function (otherwise the linker doesn't know to which it's supposed to link)
Hence inline which tells the compiler that it can consider that all the definitions of the function are the same
 
2:21 PM
which gets into the "which one does it use" roulette
 
user7659542
Interesting! Didn't know that trick!
 
So nowadays inline just means "I can have several definitions, but I guarantee that they will all be equivalent", and inlining happens as a "side effect" of the function code being always available to the compiler
 
user7659542
this is actually a way to perform polymorfism in C
 
user7659542
in an easy way
 
@traducerad no it's a way to wonder why your code is not working
 
2:25 PM
Having different definitions of a same function is "ill-formed, no diagnostic required", but if the compilers diagnoses it anyway it can still emit an error and make the compilation fail
So it's not something you can rely on
 
user7659542
what if two header files, both, included in a third header file declare the same inline function with different definitions? Does that still compile
 
user7659542
I presume that if this compile, the compiler will inline the first definition it found. Which means the order of your includes starts mattering. Which is a real pain in the ass
 
It will probably compile, but the compiler might drop a definition
 
ODR violations within one translation unit should require a diagnostic. ODR violations across translation units don't require a diagnostic and are essentially UB
 
Unless the function has internal linkage and the different definitions appear in different translation units, in which case it might be valid
I guess that it could work if it's static inline functions
 
2:40 PM
81
Q: The C tag is being displayed with a Qt icon

Keith ThompsonThe c tag is being displayed with what appears to be a Qt icon (and the qt tag is not). Tag wiki (Screenshot below)

 
user7659542
That Qt icon, is really the big hot topic of the day
 
3:43 PM
Also on the C++ tag :o
What a thrilling day
 
just not the [qt] tag, but they're getting closer
 
 
1 hour later…
4:57 PM
Haha, Malaysia is sending us our illegal plastic waste back
And they better do so that we can actually face that damn issue instead of just sending everything to the other side of the world
China, Vietnam, Thailand I think and now Malaysia
I hope that it will eventually make people react a bit
Oh, the Philippines too, good
 
Unfortunately, I'm sure they'll find some more countries that would "accept" them. Have African countries been asked about it?
(We're in the same situation here, and I'd like to that the issue be fixed rather than pushed away in the future.)
 
I don't know
 
5:17 PM
(c.f. something like this).
And hello :)
 
 
1 hour later…
6:21 PM
@Morwenn The only unfortunate thing about this is all the fossil fuels burned to ferry that both ways
(which is also wasted in the end)
 

« first day (3384 days earlier)      last day (1546 days later) »