Hi
On this sytem
$ uname -a
CYGWIN_NT-6.1 idefix 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin
I do not understand the output of this small program usinf the <vector>
container.
#include <iostream>
#include <vector>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl;
int i = 1;
int j = 2;
int k = 3;
vector<int*> v(5);
v.push_back(&i);
v.push_back(&j);
v.push_back(&k);
for( auto &n : v) {
cout << "int* =" << n;
if (n != 0)
cout << ", int=" << *n;
cout << endl;
}
return 0;
}
!!!Hello World!!!
int* =0
int* =0
int* =0
int* =0
int* =0
int* =0x22aa60, int=1
int* =0x22aa5c, int=2
int* =0x22aa58, int=3
Is this could be a bug?
FA
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with:
/cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-3/src/gcc-4.8.2/configure
--srcdir=/cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-3/src/gcc-4.8.2
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var
--sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin
--target=x86_64-pc-cygwin --without-libiconv-prefix
--without-libintl-prefix --enable-shared --enable-shared-libgcc
--enable-static --enable-version-specific-runtime-libs
--enable-bootstrap --disable-__cxa_atexit --with-dwarf2
--with-tune=generic
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp
--disable-libitm --enable-libquadmath --enable-libquadmath-support
--enable-libssp --enable-libada --enable-libgcj-sublibs
--disable-java-awt --disable-symvers
--with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix
--without-libintl-prefix --with-system-zlib --libexecdir=/usr/lib
Thread model: posix
gcc version 4.8.2 (GCC)