What is std::decay and when it should be used?
What are the reasons for the existence of std::decay? In what situations is std::decay useful? 2 Answers 2
What are the reasons for the existence of std::decay? In what situations is std::decay useful? 2 Answers 2
I might have an array that looks like the following: [1, 4, 2, 2, 6, 24, 15, 2, 60, 15, 6] Or, really, any sequence of like-typed portions of data. What I want to do is ensure that there is only one of each identical element. For example, the above array would become: [1, 4, … Read more
I’m fairly familiar with C++11’s std::thread, std::async and std::future components (e.g. see this answer), which are straight-forward. However, I cannot quite grasp what std::promise is, what it does and in which situations it is best used. The standard document itself doesn’t contain a whole lot of information beyond its class synopsis, and neither does std::thread. … Read more
Go’s standard library does not have a function solely intended to check if a file exists or not (like Python’s os.path.exists). What is the idiomatic way to do it? 13 s 13
This question already has answers here: How do I read an entire file into a std::string in C++? (22 answers) Closed 5 years ago. I need to read a whole file into memory and place it in a C++ std::string. If I were to read it into a char[], the answer would be very simple: … Read more