提交 a40b755b 编写于 作者: Y Yi Wang

Add explicit to some constructors

上级 ef8de515
......@@ -19,8 +19,6 @@
namespace paddle {
namespace operators {
using namespace paddle::framework; // NOLINT
namespace rnn {
/**
......
......@@ -55,7 +55,7 @@ class CPUDeviceContext : public DeviceContext {
class CUDADeviceContext : public DeviceContext {
public:
CUDADeviceContext(GPUPlace); // NOLINT
explicit CUDADeviceContext(GPUPlace);
virtual ~CUDADeviceContext();
/*! \brief Wait for all operations completion in the stream. */
......
......@@ -32,7 +32,7 @@ struct CPUPlace {
struct GPUPlace {
GPUPlace() : GPUPlace(0) {}
GPUPlace(int d) : device(d) {} // NOLINT
explicit GPUPlace(int d) : device(d) {}
// needed for variant equality comparison
inline bool operator==(const GPUPlace &o) const { return device == o.device; }
......
......@@ -39,8 +39,8 @@ public:
// size_ is 0.
Piece();
Piece(const char* d, size_t n);
Piece(const char* d); // NOLINT
Piece(const std::string& s); // NOLINT
explicit Piece(const char* d);
explicit Piece(const std::string& s);
const char* data() const { return data_; }
size_t len() const { return size_; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册