C++C++11C++14C++17Code SnippetLearn C++

Quickly Learn To Sort Vectors With Parallel STL Algorithm In C++ On Windows

In C++, STL Standard Template Library has many algorithms for some operations like searching, counting, and manipulation of ranges and their elements. C++17 has a new feature that you can sort vectors with Parallel STL Algorithm. In C++ Builder, Vectors can be used and sorted by Parallel STL Algorithm as below. #include #include #include #include int _tmain(int argc, _TCHAR*…
Read more
C++Learn C++Videos

Learn C++ With Functional Error and Optional-value Handling with STX by Basit Ayantunde (CPPCon 2020) Video

Error-handling is probably the most divergent part of C++. Many coding guidelines partially allow exception or completely bans, and this leads to many projects supporting multiple error-handling interfaces, such as exceptions, error-prone c-style error-handling, and/or custom error-handling types. This video talks about STX; a C++ library that seeks to fix some of these issues with error and…
Read more
C++C++11C++14C++17Learn C++

Tutorial: Learn To Sort A Text File On Windows With C++

In C++ Builder sorting text string lines is very easy by setting Sorted property of a StringList to true. This example below sorts a given text file and saves as sorted in same name. void sort_textfile(UnicodeString filename) { auto str_list = new TStringList; str_list->LoadFromFile(filename); str_list->Sorted = true; str_list->SaveToFile(filename); str_list->Free(); } Sorting…
Read more