Use modern construct 'using' instead of typedef.
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-map.h
old mode 100755 (executable)
new mode 100644 (file)
index f23f2b3..259aaae
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <string>
 #include <sstream>
+#include <initializer_list>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -35,8 +36,8 @@ namespace Dali
  * @{
  */
 
-typedef std::pair< Property::Key, Property::Value > KeyValuePair;
-typedef std::pair<std::string, Property::Value> StringValuePair;
+using KeyValuePair    = std::pair<Property::Key, Property::Value>;
+using StringValuePair = std::pair<std::string, Property::Value>;
 
 /**
  * @brief A Map of property values, the key type could be String or Property::Index.
@@ -45,8 +46,7 @@ typedef std::pair<std::string, Property::Value> StringValuePair;
 class DALI_CORE_API Property::Map
 {
 public:
-
-  typedef std::size_t SizeType;
+  using SizeType = std::size_t;
 
   /**
    * @brief Default constructor.
@@ -55,7 +55,15 @@ public:
   Map();
 
   /**
-   * @brief Copy Constructor.
+   * @brief Constructor from initializer_list.
+   *
+   * @SINCE_1_4.17
+   * @param[in] values An initializer_list of pairs of index and value.
+   */
+  Map( const std::initializer_list< KeyValuePair >& values );
+
+  /**
+   * @brief Copy constructor.
    *
    * @SINCE_1_0.0
    * @param[in] other The Map to copy from
@@ -63,11 +71,11 @@ public:
   Map( const Map& other );
 
   /**
-   * @brief Move Constructor.
+   * @brief Move constructor.
    *
    * @SINCE_1_4.17
    * @param[in] other The Map to move from
-   * @note The other array is an r-value so becomes invalid and is no longer usable.
+   * @note After the @a other array is used, it becomes invalid and is no longer usable.
    */
   Map( Map&& other );
 
@@ -359,7 +367,7 @@ public:
   Value& operator[]( Property::Index key );
 
   /**
-   * @brief Assignment Operator.
+   * @brief Assignment operator.
    *
    * @SINCE_1_0.0
    * @param[in] other The map to copy from
@@ -369,7 +377,7 @@ public:
   Map& operator=( const Map& other );
 
   /**
-   * @brief Move Assignment Operator.
+   * @brief Move assignment operator.
    *
    * @SINCE_1_4.17
    * @param[in] other The map to move from