First  |  Prev |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Perl-like qx// in C++ ?
Hi all! It does happen that I need to start another process and read it's stdout (and stderr) to a buffer to work with that. On Windows, this includes setting up a pipe, calling CreateProcess, reading from the pipe handles, copying to buffer, closing the handles etc. (I do think on posix systems it works ab... 11 Jul 2010 14:50
compilation error when Base Constructor calling pure virtual method
> Defining the constructor in the class declaration causes (requests) it to be "inlined", such that code for the function doesn't normally get inserted into your compiler's object code except at the point where it's called--but it's not called from anywhere in your example and so no code is generated; the l... 10 Jul 2010 09:24
GCC (G++) "#if x1 == x2" bug
I have verified that WCHAR_MAX and USHORT_MAX are defined to have the same value specified by MinGW 4.4.0. // Quick check of values std::cout << "WCHAR_MAX = " << WCHAR_MAX << std::endl; std::cout << "USHRT_MAX = " << USHRT_MAX << std::endl; Prints the Output WCHAR_MAX = 65535 USHRT_MAX = 65535 Could anyo... 12 Jul 2010 05:14
iterator invalidation guarantees in tr1::unordered_map
Hello- Can anyone please clarify for me, does tr1::unordered_map guarantee that iterators remain valid always (except iterators to items that have been removed?). This was definitely the case with the old SGI implementation. I am trying to transition from gcc's __gnu_cxx::hash_map to std::tr1::unordered_map in g... 15 Jul 2010 12:02
conversion operator ambiguity
The code below shows different behaviour with different compilers, and I wonder which behaviour is the right one. There's a struct X that has conversion operators to bool and to double, Instances of this struct are used in a boolean context. The idea is that the X instances are implicitly converted to bool. /* c... 11 Jul 2010 10:28
will taking the address of the first element of a string break COW strings?
On Jul 7, 6:27 am, Mathias Gaunard <loufo...(a)gmail.com> wrote: On Jul 7, 3:20 am, Brendan <catph...(a)catphive.net> wrote: With vectors, you can take the address of the first element in order to pass the underlying data to API's that take char*'s like so: vector<char> v(BUF_SIZE); // for some... 11 Jul 2010 14:50
will taking the address of the first element of a string break COW strings?
On 7 Jul., 04:20, Brendan <catph...(a)catphive.net> wrote: With std::strings I've always been leery of doing the same thing since I know that some std::string implementations, gcc's in particular, are Copy On Write. To make this safe, a COW string str would have to make a copy when you do a str[index] if ther... 7 Jul 2010 09:02
will taking the address of the first element of a string break COW strings?
On 2010-07-06 19:20, Brendan wrote: With vectors, you can take the address of the first element in order to pass the underlying data to API's that take char*'s like so: vector<char> v(BUF_SIZE); // for some function: void write_to_buf(char* buf, size_t buf_len) write_to_buf(&v[0], BUF_SIZE); Wit... 7 Jul 2010 07:56
compilation error when Base Constructor calling pure virtual method
On 7 Jul., 04:18, liam_herron <liam_her...(a)hotmail.com> wrote: Why does this compile when I define the body of the constructor in the header versus when I define the body of the constructor in the cpp file? // Works class A { public: A() {f();} virtual ~A() {} virtual void f() = 0; ... 7 Jul 2010 15:40
will taking the address of the first element of a string break COW strings?
With vectors, you can take the address of the first element in order to pass the underlying data to API's that take char*'s like so: vector<char> v(BUF_SIZE); // for some function: void write_to_buf(char* buf, size_t buf_len) write_to_buf(&v[0], BUF_SIZE); With std::strings I've always been leery of doing the ... 6 Jul 2010 22:13
First  |  Prev |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20