[CXX-951] "'ref' is not a member of 'boost'" error when compiling legacy driver in C++11 mode Created: 23/Jun/16  Updated: 19/Oct/16  Resolved: 27/Jun/16

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: legacy-1.1.3

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This is a regression introduced in legacy 1.1.2 by d861b31.

The error reads as follows:

 [2016/06/21 18:23:13.340] src/mongo/client/examples/connect.cpp: In function 'int main(int, char**)':
 [2016/06/21 18:23:13.340] src/mongo/client/examples/connect.cpp:73:49: error: 'ref' is not a member of 'boost'
 [2016/06/21 18:23:13.340]          mongo::stdx::bind(&makeOstreamAppender, boost::ref(std::cout));
 [2016/06/21 18:23:13.340]                                                  ^
 [2016/06/21 18:23:13.340] src/mongo/client/examples/connect.cpp:73:49: note: suggested alternative:
 [2016/06/21 18:23:13.340] In file included from /usr/include/c++/4.8/memory:79:0,
 [2016/06/21 18:23:13.340]                  from /usr/include/boost/config/no_tr1/memory.hpp:21,
 [2016/06/21 18:23:13.340]                  from /usr/include/boost/smart_ptr/shared_ptr.hpp:27,
 [2016/06/21 18:23:13.340]                  from /usr/include/boost/shared_ptr.hpp:17,
 [2016/06/21 18:23:13.340]                  from src/mongo/client/dbclient_rs.h:20,
 [2016/06/21 18:23:13.340]                  from src/mongo/client/dbclient.h:59,
 [2016/06/21 18:23:13.340]                  from src/mongo/client/examples/connect.cpp:29:
 [2016/06/21 18:23:13.340] /usr/include/c++/4.8/functional:493:5: note:   'std::ref'
 [2016/06/21 18:23:13.340]      ref(reference_wrapper<_Tp> __t) noexcept
 [2016/06/21 18:23:13.340]      ^
 [2016/06/21 18:23:13.644] scons: *** [build/linux2/64/c++11_on/ssl/mongo/client/examples/connect.o] Error 1
 [2016/06/21 18:23:14.365] scons: building terminated because of errors.



 Comments   
Comment by Githook User [ 27/Jun/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-951 Fix missing include of boost/ref.hpp in connect example
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/a176cea59bc295c9416d93e345fb46ee967b93df

Comment by J Rassi [ 23/Jun/16 ]

https://github.com/mongodb/mongo-cxx-driver/pull/501

Generated at Wed Feb 07 22:00:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.