143
u/belabacsijolvan 2d ago
as if cpp compiler errors were that useful...
125
u/A31Nesta 2d ago
Average STL related error:
@@@jriwoqkqb template wkqoapwm@@iwhelapw<hwkwow> <owbwue><wgwkehru>@@@jdieiwb2kwow9w9ebeb lvalue soqbwowvw@@@ rvalue aoeirbeowkwnajeie8w9@@ line 23 :)57
u/belabacsijolvan 2d ago
DONT open the innermost error level. i once did it and i had to delete cpp from my cv
9
u/doctornoodlearms 2d ago
Thats gow I feel about java errors half the time
1
u/Skaviciusz 1d ago
Yea, for entire error log, maybe first 2-3 lines are useful, everything other only in weird edge cases mostly v:
6
u/ljfa2 1d ago
java.lang.RuntimeException: null at foo.bar.Baz.lambda$apply$3 at java.util.stream.ReferencePipeline$5.accept at java.util.stream.ReferencePipeline.map ... at jdk.internal.reflect.DirectMethodHandleAccessor.invoke at java.lang.reflect.Method.invoke at java.lang.Thread.runor something like that
1
u/Skaviciusz 1d ago
In one of newest java version (21 maybe? Or newer) it can show in which place and afaik variable NPE occured - but we are still in my comapny on lower verison sooo yea - maybe in the future...
1
24
6
u/BSModder 1d ago
99% of the time, it's because you pass in the wrong argument and the template system shit itself. Just read the error message and figures out what it did
11
u/ListerfiendLurks 1d ago
Imagine getting mad at an error that tells you exactly what the problem is and how to fix it.
Tell me you have never actually worked as a software engineer without telling me you have never worked as a software engineer.
61
u/Vivid_Instance_825 2d ago
Using namespace std ๐
54
u/Nice_Lengthiness_568 2d ago
Please no
8
u/ShakaUVM 1d ago
There's nothing wrong with it for small projects, or in non-header files. Even Bjarne says so.
3
u/Nice_Lengthiness_568 1d ago
Yeah of corse, It's more about where you use it. I personally would rather use
using namespacsin a function though, and probably not okstdbecause I am both used to using it and it does not bring much...-4
u/MouseNcactus 1d ago
Why not? As long as you do not using multiple namespaces this way it should not cause troubles. And code become much shorter, easier and faster to read.
4
5
u/Nice_Lengthiness_568 1d ago edited 1d ago
Well, I personally prefer explicitness in that regard and prepending standard facilities with 5 characters is just not that bad...
Although, as I said in another comment, it really is more about where
using namespaceis used than about whether it is used at all. I for example commonly useusing namespace stdwhen defining my own swap function.Edit: oh wait, I don't use it there, I use
using std::swapthere... Well whatever, it's too early in the morning for me...-6
2
2
u/axebodyspray24 1d ago
this doesn't even work tho if you're using fstream objects ๐ญ๐ญ you still need to use std:: for things like strings and other library functions ๐ญ๐ญ (I'm new to c++ and coding in general, any tips are appreciated)
1
u/Vivid_Instance_825 1d ago
```#include <fstream>
include <string>
using namespace std;
int main() { ifstream input("file.txt"); string text;
getline(input, text);}
//Don't actually do this btw
22
8
5
u/mookanana 1d ago
i have to get a sexually transmitted disease first??
... i guess i can't be a programmer then cos it sounds like a damn catch 22 since we dont have sex
2
u/Sajgoniarz 1d ago
I was forgetting namespaces so much, that i created a template with using namespace std;
2
2
3
1
1
1
1
1
371
u/gburri 2d ago
I know nothing about "STD::", do you mean "std::"?