-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a large vector (10^9 elements) of chars, and I was wondering what is the fastest way to write such vector to a file. So far I've been using next code:
vector<char> vs;
// ... Fill vector with data
ofstream outfile("nanocube.txt", ios::out | ios::binary);
ostream_iterator<char>…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have two questions about STL
1) why STL is not thread-safe? Is there any structure that is thread-safe?
2) How to debug STL using GDB? In GDB, how can I print a vector?
>>> More
-
as seen on Oracle Blogs
- Search for 'Oracle Blogs'
If you've used C++ you undoubtedly have used the Standard Template Libraries. Designed for in-memory management of data and collections of data this is a core aspect of all C++ programs.
Berkeley DB is a database library with a variety of APIs designed to ease development, one of those APIs extends…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have an old structure class like this: typedef vector<vector<string>> VARTYPE_T; which works as a single variable. This variable can hold from one value over a list to data like a table. Most values are long,double, string or double [3] for coordinates (x,y,z). I just convert them as…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to sort a list (part of a class) in descending containg items of a struct but it doesn't compile(error: no match for 'operator-' in '__last - __first'):
sort(Result.poly.begin(), Result.poly.end(), SortDescending());
And here's SortDescending:
struct SortDescending
{
bool operator()(const…
>>> More