Adding for example compiler flags "-pedantic -Wall" will generate reorder warnings which is easy to fix. See compiler output below:
Scanning dependencies of target example
[100%] Building CXX object CMakeFiles/example.dir/example.cpp.o
In file included from /usr/include/sched.h:30:0,
from /usr/include/pthread.h:25,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/gthr-default.h:35,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/gthr.h:148,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/ext/atomicity.h:35,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/basic_string.h:39,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/string:52,
from /home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++.h:9,
from /home/vagrant/development/libcouchbase-cxx/example.cpp:1:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h: In instantiation of ‘Couchbase::Internal::RowIterator<TRow>::RowIterator(const Couchbase::Internal::RowIterator<TRow>&) [with TRow = Couchbase::ViewRow]’:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/views.h:207:53: required from here
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h:86:29: warning: ‘Couchbase::Internal::RowIterator<Couchbase::ViewRow>::rp’ will be initialized after [-Wreorder]
RowProvider<TRow> *rp = NULL;
^
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h:85:22: warning: ‘const Couchbase::ViewRow* Couchbase::Internal::RowIterator<Couchbase::ViewRow>::pp’ [-Wreorder]
const TRow *pp = NULL;
^
In file included from /home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/views.h:9:0,
from /home/vagrant/development/libcouchbase-cxx/example.cpp:2:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h:56:5: warning: when initialized here [-Wreorder]
RowIterator(const RowIterator& other) : rp(other.rp), pp(other.pp) {
^
In file included from /usr/include/sched.h:30:0,
from /usr/include/pthread.h:25,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/gthr-default.h:35,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/gthr.h:148,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/ext/atomicity.h:35,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/basic_string.h:39,
from /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/string:52,
from /home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++.h:9,
from /home/vagrant/development/libcouchbase-cxx/example.cpp:1:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h: In instantiation of ‘Couchbase::Internal::RowIterator<TRow>::RowIterator(const Couchbase::Internal::RowIterator<TRow>&) [with TRow = Couchbase::QueryRow]’:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/query.h:194:46: required from here
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h:86:29: warning: ‘Couchbase::Internal::RowIterator<Couchbase::QueryRow>::rp’ will be initialized after [-Wreorder]
RowProvider<TRow> *rp = NULL;
^
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h:85:22: warning: ‘const Couchbase::QueryRow* Couchbase::Internal::RowIterator<Couchbase::QueryRow>::pp’ [-Wreorder]
const TRow *pp = NULL;
^
In file included from /home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/views.h:9:0,
from /home/vagrant/development/libcouchbase-cxx/example.cpp:2:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/row_common.h:56:5: warning: when initialized here [-Wreorder]
RowIterator(const RowIterator& other) : rp(other.rp), pp(other.pp) {
^
In file included from /home/vagrant/development/libcouchbase-cxx/example.cpp:1:0:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/batch.inl.h: In instantiation of ‘Couchbase::CallbackCommand<C, R>::CallbackCommand(Couchbase::Client&, Couchbase::CallbackCommand<C, R>::CallbackType&) [with C = Couchbase::GetCommand; R = Couchbase::GetResponse; Couchbase::CallbackCommand<C, R>::CallbackType = const std::function<void(Couchbase::GetResponse&)>]’:
/home/vagrant/development/libcouchbase-cxx/example.cpp:70:6: required from here
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++.h:655:13: warning: ‘Couchbase::CallbackCommand<Couchbase::GetCommand, Couchbase::GetResponse>::m_ctx’ will be initialized after [-Wreorder]
Context m_ctx;
^
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++.h:654:18: warning: ‘Couchbase::CallbackCommand<Couchbase::GetCommand, Couchbase::GetResponse>::CallbackType Couchbase::CallbackCommand<Couchbase::GetCommand, Couchbase::GetResponse>::m_callback’ [-Wreorder]
CallbackType m_callback;
^
In file included from /home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++.h:773:0,
from /home/vagrant/development/libcouchbase-cxx/example.cpp:1:
/home/vagrant/development/libcouchbase-cxx/include/libcouchbase/couchbase++/batch.inl.h:76:1: warning: when initialized here [-Wreorder]
CallbackCommand<C,R>::CallbackCommand(Client& c, CallbackType& cb)
^
Linking CXX executable bin/example
[100%] Built target example