susumu.yata
null+****@clear*****
Wed Dec 5 21:26:09 JST 2012
susumu.yata 2012-12-05 21:26:09 +0900 (Wed, 05 Dec 2012) New Revision: cb724921b10f35f2029390e0f258bca6e4b1a556 https://github.com/groonga/grnxx/commit/cb724921b10f35f2029390e0f258bca6e4b1a556 Log: Use expclit (C++11) instead of GRNXX_EXPLICIT_CONVERSION. Modified files: lib/alpha/blob_vector.hpp lib/alpha/vector.hpp lib/features.hpp lib/flags_impl.hpp lib/io/chunk.hpp lib/io/file.hpp lib/io/file_info.hpp lib/io/pool.hpp lib/io/view.hpp lib/lock.hpp lib/string.hpp lib/string_builder.hpp lib/time.hpp Modified: lib/alpha/blob_vector.hpp (+1 -1) =================================================================== --- lib/alpha/blob_vector.hpp 2012-12-05 21:20:13 +0900 (4480a2b) +++ lib/alpha/blob_vector.hpp 2012-12-05 21:26:09 +0900 (44b846c) @@ -477,7 +477,7 @@ class BlobVector { return *this; } - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(impl_); } Modified: lib/alpha/vector.hpp (+1 -1) =================================================================== --- lib/alpha/vector.hpp 2012-12-05 21:20:13 +0900 (2464150) +++ lib/alpha/vector.hpp 2012-12-05 21:26:09 +0900 (07571d3) @@ -254,7 +254,7 @@ class Vector { return *this; } - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(impl_); } Modified: lib/features.hpp (+0 -12) =================================================================== --- lib/features.hpp 2012-12-05 21:20:13 +0900 (7ee71dc) +++ lib/features.hpp 2012-12-05 21:26:09 +0900 (91dd172) @@ -121,17 +121,11 @@ # if GRNXX_CLANG_HAS(cxx_constexpr) # define GRNXX_HAS_CONSTEXPR # endif // GRNXX_CLANG_HAS(cxx_constexpr) -# if GRNXX_CLANG_HAS(cxx_explicit_conversions) -# define GRNXX_HAS_EXPLICIT_CONVERSION -# endif // GRNXX_CLANG_HAS(cxx_explicit_conversions) #elif defined(GRNXX_GNUC) # define GRNXX_HAS_GNUC_BUILTIN_CLZ # if GRNXX_GNUC_VERSION >= GRNXX_GNUC_MAKE_VERSION(4, 2, 0) # define GRNXX_HAS_GNUC_BUILTIN_SYNC # endif // GRNXX_GNUC_VERSION >= GRNXX_GNUC_MAKE_VERSION(4, 2, 0) -# if GRNXX_GNUC_VERSION >= GRNXX_GNUC_MAKE_VERSION(4, 5, 0) -# define GRNXX_HAS_EXPLICIT_CONVERSION -# endif // GRNXX_GNUC_VERSION >= GRNXX_GNUC_MAKE_VERSION(4, 5, 0) # if GRNXX_GNUC_VERSION >= GRNXX_GNUC_MAKE_VERSION(4, 6, 0) # define GRNXX_HAS_CONSTEXPR # endif // GRNXX_GNUC_VERSION >= GRNXX_GNUC_MAKE_VERSION(4, 6, 0) @@ -146,12 +140,6 @@ # define GRNXX_CONSTEXPR #endif // GRNXX_HAS_CONSTEXPR -#ifdef GRNXX_HAS_EXPLICIT_CONVERSION -# define GRNXX_EXPLICIT_CONVERSION explicit -#else // GRNXX_HAS_EXPLICIT_CONVERSION -# define GRNXX_EXPLICIT_CONVERSION -#endif // GRNXX_HAS_EXPLICIT_CONVERSION - // Source features. #ifdef _POSIX_C_SOURCE Modified: lib/flags_impl.hpp (+1 -1) =================================================================== --- lib/flags_impl.hpp 2012-12-05 21:20:13 +0900 (722ec4c) +++ lib/flags_impl.hpp 2012-12-05 21:26:09 +0900 (b75a99e) @@ -31,7 +31,7 @@ class FlagsImpl { GRNXX_CONSTEXPR FlagsImpl() : flags_(0) {} GRNXX_CONSTEXPR FlagsImpl(const FlagsImpl &flags) : flags_(flags.flags_) {} - GRNXX_CONSTEXPR GRNXX_EXPLICIT_CONVERSION operator bool() const { + GRNXX_CONSTEXPR explicit operator bool() const { return flags_ != 0; } Modified: lib/io/chunk.hpp (+2 -2) =================================================================== --- lib/io/chunk.hpp 2012-12-05 21:20:13 +0900 (912dd47) +++ lib/io/chunk.hpp 2012-12-05 21:26:09 +0900 (f517fb1) @@ -47,7 +47,7 @@ class Chunk { } // Return true iff its view is available. - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(view_); } @@ -80,7 +80,7 @@ class ChunkInfo { public: ChunkInfo() : id_(0), file_id_(0), offset_(0), size_(0), reserved_(0) {} - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return size_ != 0; } Modified: lib/io/file.hpp (+1 -1) =================================================================== --- lib/io/file.hpp 2012-12-05 21:20:13 +0900 (34978fd) +++ lib/io/file.hpp 2012-12-05 21:26:09 +0900 (a872e6e) @@ -45,7 +45,7 @@ class File { File(File &&file); File &operator=(File &&file); - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(impl_); } Modified: lib/io/file_info.hpp (+1 -1) =================================================================== --- lib/io/file_info.hpp 2012-12-05 21:20:13 +0900 (b4cd16e) +++ lib/io/file_info.hpp 2012-12-05 21:26:09 +0900 (82dcc40) @@ -38,7 +38,7 @@ class FileInfo { FileInfo(FileInfo &&file_info); FileInfo &operator=(FileInfo &&file_info); - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(impl_); } Modified: lib/io/pool.hpp (+1 -1) =================================================================== --- lib/io/pool.hpp 2012-12-05 21:20:13 +0900 (0eb5129) +++ lib/io/pool.hpp 2012-12-05 21:26:09 +0900 (ff05b5f) @@ -254,7 +254,7 @@ class Pool { Pool(Pool &&pool); Pool &operator=(Pool &&pool); - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(impl_); } Modified: lib/io/view.hpp (+1 -1) =================================================================== --- lib/io/view.hpp 2012-12-05 21:20:13 +0900 (87bc37d) +++ lib/io/view.hpp 2012-12-05 21:26:09 +0900 (4c4b747) @@ -45,7 +45,7 @@ class View { View(View &&view); View &operator=(View &&view); - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return static_cast<bool>(impl_); } Modified: lib/lock.hpp (+1 -1) =================================================================== --- lib/lock.hpp 2012-12-05 21:20:13 +0900 (f3c1e88) +++ lib/lock.hpp 2012-12-05 21:26:09 +0900 (0113ece) @@ -36,7 +36,7 @@ class Lock { } } - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return mutex_object_ != nullptr; } Modified: lib/string.hpp (+1 -1) =================================================================== --- lib/string.hpp 2012-12-05 21:20:13 +0900 (f09f14b) +++ lib/string.hpp 2012-12-05 21:26:09 +0900 (dece798) @@ -105,7 +105,7 @@ class String { String &operator=(const char *str); - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return impl_->length() != 0; } Modified: lib/string_builder.hpp (+1 -1) =================================================================== --- lib/string_builder.hpp 2012-12-05 21:20:13 +0900 (8d7a6e8) +++ lib/string_builder.hpp 2012-12-05 21:26:09 +0900 (0406c6b) @@ -88,7 +88,7 @@ class StringBuilder { return *this; } - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return !failed_; } Modified: lib/time.hpp (+1 -1) =================================================================== --- lib/time.hpp 2012-12-05 21:20:13 +0900 (4acce84) +++ lib/time.hpp 2012-12-05 21:26:09 +0900 (a1b4b38) @@ -37,7 +37,7 @@ class Time { return Time(); } - GRNXX_EXPLICIT_CONVERSION operator bool() const { + explicit operator bool() const { return nanoseconds_ != TIME_INVALID_NANOSECONDS; } -------------- next part -------------- HTML����������������������������...Download