Advertisement

Problem with variable arguments

Started by November 08, 2015 02:46 AM
29 comments, last by Aardvajk 9 years, 1 month ago
You shouldn't add functions in namespace std. I forgot the exact rules, but the vast majority of the time you'll be in undefined-behavior land.

You shouldn't add functions in namespace std. I forgot the exact rules, but the vast majority of the time you'll be in undefined-behavior land.

I didn't - I added it to the global namespace.

Advertisement

You shouldn't add functions in namespace std. I forgot the exact rules, but the vast majority of the time you'll be in undefined-behavior land.


I didn't - I added it to the global namespace.


Oh, I misread your code. Sorry about that.
Np. I had to double-check to make sure I had actually removed the std:: when I posted it, because in my own codebase I willing homestead in that particular area of undefined-behavior land. ph34r.png

Some programmers would have a heart attack if they saw my header file where I illegally forward declare many members of the standard library. laugh.png

I don't know if I can enable C++14 in my compiler :S

This is my current compiler:

HoaHCBF.png

That's the same version I'm using (though a different build). Pass -std=c++1y instead of -std=c++11, and you'll gain access to most the C++14 stuff.

Some things aren't available, but alot is, including std::make_unique. There are later builds available, next time you decide to upgrade. I personally upgrade once or twice a year.

Advertisement

That's the same version I'm using (though a different build). Pass -std=c++1y instead of -std=c++11, and you'll gain access to most the C++14 stuff.

Some things aren't available, but alot is, including std::make_unique. There are later builds available, next time you decide to upgrade. I personally upgrade once or twice a year.

Ok thanks :) I'll try it later.

That's the same version I'm using (though a different build). Pass -std=c++1y instead of -std=c++11, and you'll gain access to most the C++14 stuff.


Why 'c++1y' instead of 'c++14'? I'm fairly certain the 4.9.2-generation of GCCs/MinGWs should support that (within the known limits). At least at home that works fine.

Why 'c++1y' instead of 'c++14'? I'm fairly certain the 4.9.2-generation of GCCs/MinGWs should support that (within the known limits). At least at home that works fine.

You're right; I'm wasn't sure what version "c++14" became the command-line parameter to use, so I just grabbed the commandline from my qmake file since I know it works for the version the OP is using. You're correct though, switching it to c++14 still compiled my project fine. I'll update the parameter in my codebase; or maybe I'll just jump to c++1z next time I update the compiler. laugh.png

Well, over at MinGW-builds there are already several different 5.x versions available. I did not find the time to try a switch though, yet. I'm pretty sure it should be taken with care as well, I believe there was an ABI breaking change somewhere between 4.9.2 and 5.

This topic is closed to new replies.

Advertisement