« first day (3867 days earlier)      last day (1064 days later) » 

7:39 AM
Hi
 
Did we come up with some fun uses where constexpr const was not redundant? Migrate char literals or something?
 
what do you mean?
 
12
Q: Is `const constexpr` on variables redundant?

Pharapcppreference states that: A constexpr specifier used in an object declaration or non-static member function (until C++14) implies const. Does "object declaration" mean "any variable declaration"? I.e. is constexpr const int someConstant = 3; equivalent to constexpr int someConstant...

 
idk
 
nwp
I did run into that recently.
May 5 at 11:10, by nwp
I ran into my first occurrence of constexpr const where you can remove neither keyword.
Unfortunately I don't remember what exactly it was 🤡
 
7:53 AM
constexpr const char* is the canonical example IIRC
 
Also can we blame Jerry for "-fPIC" and "-fpic" being different flags?
 
nwp
I think I ended up removing it. Rip.
And yes, blaming Jerry cannot possibly be wrong.
 
Wow, and I thought this was a nice chatroom
 
nwp
It's very nice. Just don't be Jerry. I did it and you did too. It's not difficult. Except Jerry failed, but that's to be expected.
 
So, how do we deal with the looming threat that one way somebody will make us use a backwards and feature-incomplete compiler like Clang (trunk). Wtf happened to clang.
 
nwp
8:03 AM
Blame Google Jerry.
 
Blame which Jerry?
 
nwp
All of them.
 
What if they change name?
 
nwp
That's cheating.
@Mikhail I don't think anyone will make you use clang trunk. And there are 2.5 viable alternatives, so even if clang becomes unusable it's not the end of the world.
 
I'm just kinda worried because the computer engineering world is drifting towards using clang due to LLVM
How will I coup without a spaceship operator :-(
 
nwp
8:06 AM
Clang is very neat. It added so many great tools that I don't want to miss.
 
clang-tidy is almost non-functional
On an unrelated note: 0,1,2,3,4 are not magic numbers but 5 is...
 
nwp
If you don't like the check turn it off :shrug:
There might also be a configuration for that.
Personally I'd count 3 and 4 as magic numbers.
 
I'd also count 0 as a magic number, and if its written as nullptr then its not :-)
although maybe gets screwed up in size() > 1
 
nwp
for (int i = STANDARD_LOOP_START_VALUE; i < size; i++)
 
needs more auto and ++i
 
nwp
8:11 AM
You could argue that i++ has an implicit magic number 1.
And no, i++ is perfectly fine.
 
your loop will die when you got more than 2^31 indexes :-)
 
Just unsightly
 
nwp
I got a tetanus shot this morning. I still feel a little sick.
 
Is that what Europeans are doing instead of COVID shots?
 
nwp
Not instead of. It's just that they require you to have a vaccination pass or whatever that's called in English and then you notice you haven't done your other vaccinations either.
I have an appointment for a corona shot at the end of July. Maybe there are alternatives available before then.
 
8:17 AM
I should get my first COVID shot by the end of the week
 
I wonder if a specialized instruction can make "-fPIC" faster? It seems that position independent code requires all function calls to include an addition operation, AKA jump current position + some_amount. Could that operation be contracted into one instruction?
 
9:04 AM
I'm working on a simple project in which I'm supposed to take contacts of users and save it to a file,but I know searching may consume a lot of time so I thought to store the data in a sorted order so that the runtime can be reduced in searching contacts but stucked how to do that
Somebody help me out
 
9:22 AM
Oh I Got That I Could Have Used A Hash Table LoL I'm Dumb
Oh I Got That I Could Have Used A Hash Table LoL I'm Dumb
 
 
4 hours later…
1:21 PM
O(1) Put And Get Operations On An LRU Cache How's That Possible? I have read this question somewhere I forgot where.
 
nwp
Arguably it's just nonsense. Complexity theory describes a function's behavior as the input grows, but in the case of the cache the input (the size of the cache) is fixed.
 
I Didn't Get That like if I am using an linked list for get(x) I would have to iterate over the linked list to find x
 
nwp
Sure. But if your linked list always has 10 elements then it's O(1).
Iterating over the whole list takes a fixed amount of time.
 
What if it exceeds 10
 
nwp
Then you need to build a new cache that has different characteristics than the old cache.
If you actually have something that can grow then complexity theory becomes relevant again.
 
1:35 PM
You Mean 2 Different Cache Which At The End Is A Single Cache
 
nwp
No. I mean that unlike the linked list the cache cannot grow. If you really needed it to grow you'd build a new cache, but then it might not have the same access times anymore.
 
Oh got that
 
if n doesn't change then everything is O(1)
 
 
6 hours later…
 
4 hours later…
11:26 PM
@StackedCrooked I have to disagree. The latter seems to be silent, with a really boring video.
If that has enough originality to qualify for copyright, it appears a lot of others are infringing it though!
 

« first day (3867 days earlier)      last day (1064 days later) »