Anonymous
Using typedefs in C++17 is kinda lame
Anonymous
Anonymous
But tbh I don't get what you need
Anonymous
Pavel
C++11 type aliases can be templated
That's not what I meant about template specifications. I meant having the ability to have different template specifications for different types of aliases.
E.g. if I have an alias like that
using PathStr = std::string;
I want to be able to have different implementations for them in cases like that
ConstructEditor<std::string>();
ConstructEditor<PathStr>();
And that this will not compile:
std::string a = "test";
PathStr b = "/test";
if (a == b) {
...
}
as well as this
std::string a = "test";
PathStr b = a;
or this
PathStr a = "/test";
std::string b = a;
but this would compile
std::string a = "test";
PathStr b = static_cast<PathStr>(a);
Anonymous
Anonymous
Pavel
Well, even that would be fine, as long as I don't delete my classes using a pointer to std::string. But I guess even that would be fine because I don't provide any new members.
Ilya
Anonymous
Ok
Ilya
2foryou
I am using unordered map and I have string keys for example "saldhkagdka" later on I check
if (!un_map["simple_example"]){
// do stuff
}
i get segmentation fault can you tell me how can I forbid accessing If out of range but know when a vallue of a key exist?
Anonymous
Anonymous
If a key is not in a map, it inserts key and a value for that is default initilized
2foryou
ok so I have to find why
thanks
2foryou
so in this example you are sayng that "simple_example" is added to the map whith empty vllue?
Javi
If you are using the value of the map inside the if, that's why. As @Danya said, when the key doesn't exist, it inserts a value, what would give you undefined behaviour depending on what's inside the if
Anonymous
Anonymous
Returns a reference to the value that is mapped to a key equivalent to key, performing an insertion if such key does not already exist.
Anonymous
so, basically yes
Ludovic 'Archivist'
2foryou
inside the If I do some calculation with the vallue that I have in the if condition
what If I want to access that vallue only if it exist and not Insert it if it does not just skip the if?
Anonymous
Anonymous
yes, use find/count
Anonymous
anyway, look at here for more information: https://en.cppreference.com/w/cpp/container/unordered_map
Anonymous
i installed gcc but for some reason its not in the right path
Anonymous
when i to gcc -v it shows the old gcc version
Anonymous
but when i try go bew install it says i have the the new version already
Anonymous
how do i install gcc in the proper path
Anonymous
helo
Anonymous
anyone there
01000001011011010100000101101110
Can you purge the old version?
Anonymous
Anonymous
i am using hombrew on a mac
Anonymous
been trying to get help with this for two days now
01000001011011010100000101101110
01000001011011010100000101101110
So can you remove/delete the older version?
Anonymous
Anonymous
Nameful
How would I tell CMake to compile a specific file and use it as a library for my project?
Nameful
I have ./include/glad/glad.h, which I have managed to get set up, and then glad.c which I haven't figured out how to set up
Nameful
Currently it complains about undefined references
Nameful
If I add glad.c to my add_executable() it gives me this
Nameful
Not entirely sure what that's about
Anonymous
Hey, whats the "correct" way to pass a static multi dimenstional array by reference to a function? (In ansi c). My soluution was to pass the dimenstions+size and a char pointer to the beginning and cast it back in the function to work on it. But i think this ist very elegant or the way one is supposed to do that.
@t
Such is a very good heart
Anonymous
mushaffiq
Can any one send me sll in c video
I_Interface
mushaffiq
Any nice youtube
mushaffiq
Are mere bhai koi acha youtber bol mujhe smajahe
Talula
mushaffiq
😅
klimi
This is a joke right? @roxifas
Roxifλsz 🇱🇹
Roxifλsz 🇱🇹
/warn offtopic
Roxifλsz 🇱🇹
Oh well
Roxifλsz 🇱🇹
That solves that
klimi
Anonymous
Any CMAKE/VCPKG users?, Mine is always thorwing this
Could not find a configuration file for package "spdlog" that is compatible
with requested version "".
The following configuration files were considered but not accepted:
D:/Data/vcpkg/installed/x64-windows/share/spdlog/spdlogConfig.cmake, version: 1.3.1 (64bit)
Anonymous
https://hasteb.in/donawila.m
Anonymous
I think the architecture aint set or so
many
I've been implementing snake game in terminal. Whenever the snake moves, the screen refreshes. However the screen flashes when the snake moves faster. How to reduce/avoid the flashes (like "less" command)?
Foxner
many
many
What's the magic behind the "less" command? Seems that it doesn't need redrawing. It simply create a new environment and users can navigate up and down
Jussi
Foxner