Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
added explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Jun 23, 2016
1 parent 7ef82c7 commit 5e22e60
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/boost/process/detail/posix/async_pipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class async_pipe
public:
typedef int native_handle;

inline async_pipe(boost::asio::io_service & ios) : _source(ios), _sink(ios)
inline explicit async_pipe(boost::asio::io_service & ios) : _source(ios), _sink(ios)
{
int fds[2];
if (::pipe(fds) == -1)
Expand All @@ -30,7 +30,7 @@ class async_pipe
_source.assign(fds[0]);
_sink .assign(fds[1]);
};
inline async_pipe(boost::asio::io_service & ios, const std::string & name);
inline explicit async_pipe(boost::asio::io_service & ios, const std::string & name);
inline async_pipe(const async_pipe& lhs);
async_pipe(async_pipe&& lhs) : _source(std::move(lhs._source)), _sink(std::move(lhs._sink))
{
Expand Down
6 changes: 3 additions & 3 deletions include/boost/process/detail/posix/basic_pipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class basic_pipe
int _source = -1;
int _sink = -1;
public:
basic_pipe(int source, int sink) : _source(source), _sink(sink) {}
basic_pipe(int source, int sink, const std::string & name) : _source(source), _sink(sink) {}
explicit basic_pipe(int source, int sink) : _source(source), _sink(sink) {}
explicit basic_pipe(int source, int sink, const std::string & name) : _source(source), _sink(sink) {}
typedef CharT char_type ;
typedef Traits traits_type;
typedef typename Traits::int_type int_type ;
Expand All @@ -47,7 +47,7 @@ class basic_pipe
_sink = fds[1];
}
basic_pipe(const basic_pipe& rhs);
basic_pipe(const std::string& name);
explicit basic_pipe(const std::string& name);
basic_pipe(basic_pipe&& lhs) : _source(lhs._source), _sink(lhs._sink)
{
lhs._source = -1;
Expand Down
6 changes: 3 additions & 3 deletions include/boost/process/detail/posix/file_descriptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ struct file_descriptor


file_descriptor() = default;
file_descriptor(const boost::filesystem::path& p, mode_t mode = read_write)
explicit file_descriptor(const boost::filesystem::path& p, mode_t mode = read_write)
: file_descriptor(p.native(), mode)
{
}

file_descriptor(const std::string & path , mode_t mode = read_write)
explicit file_descriptor(const std::string & path , mode_t mode = read_write)
: file_descriptor(path.c_str(), mode) {}


file_descriptor(const char* path, mode_t mode = read_write)
explicit file_descriptor(const char* path, mode_t mode = read_write)
: _handle(create_file(path, mode))
{

Expand Down
2 changes: 1 addition & 1 deletion include/boost/process/detail/windows/basic_pipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class basic_pipe
typedef typename Traits::off_type off_type ;
typedef ::boost::detail::winapi::HANDLE_ native_handle;

basic_pipe(::boost::detail::winapi::HANDLE_ source, ::boost::detail::winapi::HANDLE_ sink)
explicit basic_pipe(::boost::detail::winapi::HANDLE_ source, ::boost::detail::winapi::HANDLE_ sink)
: _source(source), _sink(sink) {}
inline explicit basic_pipe(const std::string & name);
inline basic_pipe(const basic_pipe& p);
Expand Down
8 changes: 4 additions & 4 deletions include/boost/process/environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ struct const_entry
return string_type();
}
string_type get_name() const {return string_type(_name.begin(), _name.end());}
const_entry(string_type&& name, pointer data, environment_t & env) :
explicit const_entry(string_type&& name, pointer data, environment_t & env) :
_name(std::move(name)), _data(data), _env(&env) {}

const_entry(string_type &&name, environment_t & env) :
explicit const_entry(string_type &&name, environment_t & env) :
_name(std::move(name)), _data(nullptr), _env(&env) {}
const_entry(const const_entry&) = default;
const_entry& operator=(const const_entry&) = default;
Expand Down Expand Up @@ -88,10 +88,10 @@ struct entry : const_entry<Char, Environment>
using pointer = typename father::pointer;
using environment_t = typename father::environment_t;

entry(string_type&& name, pointer data, environment_t & env) :
explicit entry(string_type&& name, pointer data, environment_t & env) :
father(std::move(name), data, env) {}

entry(string_type &&name, environment_t & env) :
explicit entry(string_type &&name, environment_t & env) :
father(std::move(name), env) {}

entry(const entry&) = default;
Expand Down

0 comments on commit 5e22e60

Please sign in to comment.