compilation: fix boost::shared_ptr->bool issue under C++14
The implicit conversion of boost::shared_ptr->bool is no longer supported when compiling as C++14 (the default under gcc 6). We have to cast explicitly. Fixes errors like this: Logging.h:258:41: error: cannot convert 'const boost::shared_ptr<SyncEvo::Logger>' to 'bool' in return operator bool () const { return m_logger; }
This commit is contained in:
parent
4e2dd07580
commit
3299613591
|
@ -425,7 +425,7 @@ public:
|
|||
void setServerAlerted(bool serverAlerted) { m_serverAlerted = serverAlerted; }
|
||||
|
||||
void initServer(SharedBuffer data, const std::string &messageType);
|
||||
void setStubConnection(const boost::shared_ptr<Connection> c) { m_connection = c; m_useConnection = c; }
|
||||
void setStubConnection(const boost::shared_ptr<Connection> c) { m_connection = c; m_useConnection = static_cast<bool>(c); }
|
||||
boost::weak_ptr<Connection> getStubConnection() { return m_connection; }
|
||||
bool useStubConnection() { return m_useConnection; }
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ class Logger
|
|||
Handle &operator = (const Handle &other) throw ();
|
||||
~Handle() throw ();
|
||||
|
||||
operator bool () const { return m_logger; }
|
||||
operator bool () const { return static_cast<bool>(m_logger); }
|
||||
bool operator == (Logger *logger) const { return m_logger.get() == logger; }
|
||||
Logger *get() const { return m_logger.get(); }
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class StringDataBlob : public DataBlob
|
|||
|
||||
virtual boost::shared_ptr<std::string> getData() { return m_data; }
|
||||
virtual std::string getName() const { return m_name; }
|
||||
virtual bool exists() const { return m_data; }
|
||||
virtual bool exists() const { return static_cast<bool>(m_data); }
|
||||
virtual bool isReadonly() const { return m_readonly; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue