(AUTOMATIC) opensource update (#162)

diff --git a/android/build.gradle b/android/build.gradle
index da6e3ac..3494d03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -34,7 +34,6 @@
     compile project(':common')
     compile 'com.google.android.gms:play-services-location:10.0.0'
     compile 'com.google.android.gms:play-services-places:9.2.0'
-    compile 'com.android.support:design:26.1.0'
 }
 
 android {
diff --git a/android/src/androidTest/java/com/android/i18n/addressinput/AddressWidgetUiComponentProviderTest.java b/android/src/androidTest/java/com/android/i18n/addressinput/AddressWidgetUiComponentProviderTest.java
index 8edfd0f..641623a 100644
--- a/android/src/androidTest/java/com/android/i18n/addressinput/AddressWidgetUiComponentProviderTest.java
+++ b/android/src/androidTest/java/com/android/i18n/addressinput/AddressWidgetUiComponentProviderTest.java
@@ -16,11 +16,6 @@
 
 package com.android.i18n.addressinput;
 
-import com.google.i18n.addressinput.common.AddressData;
-import com.google.i18n.addressinput.common.AddressField;
-import com.google.i18n.addressinput.common.FormOptions;
-import com.google.i18n.addressinput.common.SimpleClientCacheManager;
-
 import android.app.ProgressDialog;
 import android.content.Context;
 import android.test.ActivityInstrumentationTestCase2;
@@ -30,8 +25,11 @@
 import android.widget.LinearLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
-
 import com.android.i18n.addressinput.testing.TestActivity;
+import com.google.i18n.addressinput.common.AddressData;
+import com.google.i18n.addressinput.common.AddressField;
+import com.google.i18n.addressinput.common.FormOptions;
+import com.google.i18n.addressinput.common.SimpleClientCacheManager;
 
 /**
  * Test class for {@link AddressWidgetUiComponentProvider}.
@@ -112,7 +110,7 @@
     }
   }
 
-  private class CustomArrayAdapter<String> extends ArrayAdapter<String> {
+  private class CustomArrayAdapter extends ArrayAdapter<String> {
     CustomArrayAdapter(Context context, int id) {
       super(context, id);
     }
@@ -143,8 +141,8 @@
 
     @Override
     protected ArrayAdapter<String> createUiPickerAdapter(AddressField.WidthType widthType) {
-      ArrayAdapter<String> result = new CustomArrayAdapter<String>(
-          context, android.R.layout.simple_spinner_item);
+      ArrayAdapter<String> result =
+          new CustomArrayAdapter(context, android.R.layout.simple_spinner_item);
       result.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
       return result;
     }
diff --git a/android/src/main/java/com/android/i18n/addressinput/AddressWidget.java b/android/src/main/java/com/android/i18n/addressinput/AddressWidget.java
index 4684341..5bb008f 100644
--- a/android/src/main/java/com/android/i18n/addressinput/AddressWidget.java
+++ b/android/src/main/java/com/android/i18n/addressinput/AddressWidget.java
@@ -228,6 +228,11 @@
     // Returns the region key for the region value.
     public String getRegionDataKeyForValue(String value) {
       for (RegionData data : currentRegions) {
+        if (data.getDisplayName().equals(value)) {
+          return data.getKey();
+        }
+      }
+      for (RegionData data : currentRegions) {
         if (data.getDisplayName().endsWith(value)) {
           return data.getKey();
         }
diff --git a/common/src/main/java/com/google/i18n/addressinput/common/RegionDataConstants.java b/common/src/main/java/com/google/i18n/addressinput/common/RegionDataConstants.java
index c977695..78b75b9 100644
--- a/common/src/main/java/com/google/i18n/addressinput/common/RegionDataConstants.java
+++ b/common/src/main/java/com/google/i18n/addressinput/common/RegionDataConstants.java
@@ -78,11 +78,12 @@
     map.put("CN", "{\"name\":\"CHINA\",\"lang\":\"zh\",\"languages\":\"zh\",\"lfmt\":\"%N%n%O%n%A%n%D%n%C%n%S, %Z\",\"fmt\":\"%Z%n%S%C%D%n%A%n%O%n%N\",\"require\":\"ACSZ\",\"upper\":\"S\",\"sublocality_name_type\":\"district\",\"width_overrides\":\"%S:S%C:S%D:S\",\"label_overrides\":[{\"field\":\"C\",\"label\":\"市/自治州/地区/盟\",\"lang\":\"zh\"},{\"field\":\"S\",\"label\":\"省/自治区/直辖市\",\"lang\":\"zh\"},{\"field\":\"D\",\"label\":\"区/县/旗\",\"lang\":\"zh\"}]}");
     map.put("CO", "{\"name\":\"COLOMBIA\",\"fmt\":\"%N%n%O%n%A%n%C, %S, %Z\",\"require\":\"AS\",\"state_name_type\":\"department\"}");
     map.put("CR", "{\"name\":\"COSTA RICA\",\"fmt\":\"%N%n%O%n%A%n%S, %C%n%Z\",\"require\":\"ACS\"}");
+    map.put("CU", "{\"name\":\"CUBA\",\"fmt\":\"%N%n%O%n%A%n%S%C%n%Z\"}");
     map.put("CV", "{\"name\":\"CAPE VERDE\",\"lang\":\"pt\",\"languages\":\"pt\",\"fmt\":\"%N%n%O%n%A%n%Z %C%n%S\",\"state_name_type\":\"island\"}");
     map.put("CW", "{\"name\":\"CURACAO\"}");
     map.put("CX", "{\"name\":\"CHRISTMAS ISLAND\",\"fmt\":\"%O%n%N%n%A%n%C %S %Z\",\"upper\":\"CS\"}");
     map.put("CY", "{\"name\":\"CYPRUS\",\"fmt\":\"%N%n%O%n%A%n%Z %C\"}");
-    map.put("CZ", "{\"name\":\"CZECH REP.\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"label_overrides\":[{\"field\":\"NH\",\"label\":\"Obecní část\",\"lang\":\"cs\"},{\"field\":\"NH\",\"label\":\"Obecný časť\",\"lang\":\"sk\"},{\"field\":\"BI\",\"label\":\"Descriptive No.\"},{\"field\":\"BI\",\"label\":\"Popisné číslo\",\"lang\":\"cs\"},{\"field\":\"BI\",\"label\":\"Súpisné číslo\",\"lang\":\"sk\"},{\"field\":\"SN\",\"label\":\"Orientation No.\"},{\"field\":\"SN\",\"label\":\"Orientační číslo\",\"lang\":\"cs\"},{\"field\":\"SN\",\"label\":\"Orientačné číslo\",\"lang\":\"sk\"},{\"field\":\"S1\",\"label\":\"City District\"},{\"field\":\"S1\",\"label\":\"Městská část\",\"lang\":\"cs\"},{\"field\":\"S1\",\"label\":\"Mestská časť\",\"lang\":\"sk\"}]}");
+    map.put("CZ", "{\"name\":\"CZECH REP.\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\",\"label_overrides\":[{\"field\":\"NH\",\"label\":\"Obecní část\",\"lang\":\"cs\"},{\"field\":\"NH\",\"label\":\"Obecný časť\",\"lang\":\"sk\"},{\"field\":\"BI\",\"label\":\"Descriptive No.\"},{\"field\":\"BI\",\"label\":\"Popisné číslo\",\"lang\":\"cs\"},{\"field\":\"BI\",\"label\":\"Súpisné číslo\",\"lang\":\"sk\"},{\"field\":\"SN\",\"label\":\"Orientation No.\"},{\"field\":\"SN\",\"label\":\"Orientační číslo\",\"lang\":\"cs\"},{\"field\":\"SN\",\"label\":\"Orientačné číslo\",\"lang\":\"sk\"},{\"field\":\"S1\",\"label\":\"City District\"},{\"field\":\"S1\",\"label\":\"Městská část\",\"lang\":\"cs\"},{\"field\":\"S1\",\"label\":\"Mestská časť\",\"lang\":\"sk\"}]}");
     map.put("DE", "{\"name\":\"GERMANY\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\"}");
     map.put("DJ", "{\"name\":\"DJIBOUTI\"}");
     map.put("DK", "{\"name\":\"DENMARK\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\"}");
@@ -131,7 +132,7 @@
     map.put("IE", "{\"name\":\"IRELAND\",\"lang\":\"en\",\"languages\":\"en\",\"fmt\":\"%N%n%O%n%A%n%D%n%C%n%S %Z\",\"sublocality_name_type\":\"townland\",\"state_name_type\":\"county\",\"zip_name_type\":\"eircode\",\"label_overrides\":[{\"field\":\"S\",\"label\":\"郡\",\"lang\":\"zh\"}]}");
     map.put("IL", "{\"name\":\"ISRAEL\",\"fmt\":\"%N%n%O%n%A%n%C %Z\"}");
     map.put("IM", "{\"name\":\"ISLE OF MAN\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"require\":\"ACZ\",\"upper\":\"CZ\"}");
-    map.put("IN", "{\"name\":\"INDIA\",\"lang\":\"en\",\"languages\":\"en~hi\",\"fmt\":\"%N%n%O%n%A%n%C %Z%n%S\",\"require\":\"ACSZ\",\"state_name_type\":\"state\",\"zip_name_type\":\"pin\"}");
+    map.put("IN", "{\"name\":\"INDIA\",\"lang\":\"en\",\"languages\":\"en~hi\",\"fmt\":\"%N%n%O%n%A%n%C %Z%n%S\",\"require\":\"ACSZ\",\"state_name_type\":\"state\",\"zip_name_type\":\"pin\",\"label_overrides\":[{\"field\":\"S1\",\"label\":\"Sublocality 1\"},{\"field\":\"S2\",\"label\":\"Sublocality 2\"},{\"field\":\"S3\",\"label\":\"Sublocality 3\"},{\"field\":\"S4\",\"label\":\"Sublocality 4\"}]}");
     map.put("IO", "{\"name\":\"BRITISH INDIAN OCEAN TERRITORY\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"require\":\"ACZ\",\"upper\":\"CZ\"}");
     map.put("IQ", "{\"name\":\"IRAQ\",\"fmt\":\"%O%n%N%n%A%n%C, %S%n%Z\",\"require\":\"ACS\",\"upper\":\"CS\"}");
     map.put("IR", "{\"name\":\"IRAN\",\"fmt\":\"%O%n%N%n%S%n%C, %D%n%A%n%Z\",\"sublocality_name_type\":\"neighborhood\"}");
@@ -140,13 +141,14 @@
     map.put("JE", "{\"name\":\"CHANNEL ISLANDS\",\"fmt\":\"%N%n%O%n%A%n%C%nJERSEY%n%Z\",\"require\":\"ACZ\",\"upper\":\"CZ\"}");
     map.put("JM", "{\"name\":\"JAMAICA\",\"lang\":\"en\",\"languages\":\"en\",\"fmt\":\"%N%n%O%n%A%n%C%n%S %X\",\"require\":\"ACS\",\"state_name_type\":\"parish\"}");
     map.put("JO", "{\"name\":\"JORDAN\",\"fmt\":\"%N%n%O%n%A%n%C %Z\"}");
-    map.put("JP", "{\"name\":\"JAPAN\",\"lang\":\"ja\",\"languages\":\"ja\",\"lfmt\":\"%N%n%O%n%A%n%C, %S%n%Z\",\"fmt\":\"〒%Z%n%S%C%n%A%n%O%n%N\",\"require\":\"ACSZ\",\"upper\":\"S\",\"state_name_type\":\"prefecture\",\"width_overrides\":\"%S:S\",\"label_overrides\":[{\"field\":\"JED\",\"label\":\"Edaban\"},{\"field\":\"JED\",\"label\":\"枝番\",\"lang\":\"ja\"},{\"field\":\"JCH\",\"label\":\"Banchi\"},{\"field\":\"JCH\",\"label\":\"番地\",\"lang\":\"ja\"},{\"field\":\"JGA\",\"label\":\"Gaiku\"},{\"field\":\"JGA\",\"label\":\"街区\",\"lang\":\"ja\"},{\"field\":\"JKO\",\"label\":\"Koaza\"},{\"field\":\"JKO\",\"label\":\"小字\",\"lang\":\"ja\"},{\"field\":\"JOO\",\"label\":\"Ōaza\"},{\"field\":\"JOO\",\"label\":\"大字\",\"lang\":\"ja\"},{\"field\":\"JSS\",\"label\":\"Ku\"},{\"field\":\"JSS\",\"label\":\"区\",\"lang\":\"ja\"},{\"field\":\"JSH\",\"label\":\"Shi\"},{\"field\":\"JSH\",\"label\":\"市\",\"lang\":\"ja\"},{\"field\":\"JGN\",\"label\":\"Gun\"},{\"field\":\"JGN\",\"label\":\"郡\",\"lang\":\"ja\"}]}");
+    map.put("JP", "{\"name\":\"JAPAN\",\"lang\":\"ja\",\"languages\":\"ja\",\"lfmt\":\"%N%n%O%n%A, %S%n%Z\",\"fmt\":\"〒%Z%n%S%n%A%n%O%n%N\",\"require\":\"ASZ\",\"upper\":\"S\",\"state_name_type\":\"prefecture\",\"width_overrides\":\"%S:S\",\"label_overrides\":[{\"field\":\"JED\",\"label\":\"Edaban\"},{\"field\":\"JED\",\"label\":\"枝番\",\"lang\":\"ja\"},{\"field\":\"JCH\",\"label\":\"Banchi\"},{\"field\":\"JCH\",\"label\":\"番地\",\"lang\":\"ja\"},{\"field\":\"JGA\",\"label\":\"Gaiku\"},{\"field\":\"JGA\",\"label\":\"街区\",\"lang\":\"ja\"},{\"field\":\"JKO\",\"label\":\"Koaza\"},{\"field\":\"JKO\",\"label\":\"小字\",\"lang\":\"ja\"},{\"field\":\"JOO\",\"label\":\"Ōaza\"},{\"field\":\"JOO\",\"label\":\"大字\",\"lang\":\"ja\"},{\"field\":\"JSS\",\"label\":\"Ku\"},{\"field\":\"JSS\",\"label\":\"区\",\"lang\":\"ja\"},{\"field\":\"JSH\",\"label\":\"Shi\"},{\"field\":\"JSH\",\"label\":\"市\",\"lang\":\"ja\"},{\"field\":\"JGN\",\"label\":\"Gun\"},{\"field\":\"JGN\",\"label\":\"郡\",\"lang\":\"ja\"}]}");
     map.put("KE", "{\"name\":\"KENYA\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\"}");
     map.put("KG", "{\"name\":\"KYRGYZSTAN\",\"fmt\":\"%N%n%O%n%A%n%Z %C\"}");
     map.put("KH", "{\"name\":\"CAMBODIA\",\"fmt\":\"%N%n%O%n%A%n%C %Z\"}");
     map.put("KI", "{\"name\":\"KIRIBATI\",\"fmt\":\"%N%n%O%n%A%n%S%n%C\",\"upper\":\"ACNOS\",\"state_name_type\":\"island\"}");
     map.put("KM", "{\"name\":\"COMOROS\",\"upper\":\"AC\"}");
     map.put("KN", "{\"name\":\"SAINT KITTS AND NEVIS\",\"lang\":\"en\",\"languages\":\"en\",\"fmt\":\"%N%n%O%n%A%n%C, %S\",\"require\":\"ACS\",\"state_name_type\":\"island\"}");
+    map.put("KP", "{\"name\":\"NORTH KOREA\",\"lang\":\"ko\",\"languages\":\"ko\",\"lfmt\":\"%N%n%O%n%A%n%C%n%S, %Z\",\"fmt\":\"%Z%n%S%n%C%n%A%n%O%n%N\"}");
     map.put("KR", "{\"name\":\"SOUTH KOREA\",\"lang\":\"ko\",\"languages\":\"ko\",\"lfmt\":\"%N%n%O%n%A%n%D%n%C%n%S%n%Z\",\"fmt\":\"%S %C%D%n%A%n%O%n%N%n%Z\",\"require\":\"ACSZ\",\"upper\":\"Z\",\"sublocality_name_type\":\"district\",\"state_name_type\":\"do_si\",\"label_overrides\":[{\"field\":\"LP\",\"message\":\"MSG_STREET_NUMBER\"},{\"field\":\"S2\",\"message\":\"MSG_NEIGHBORHOOD\"},{\"field\":\"S4\",\"message\":\"MSG_STREET_NAME\"}]}");
     map.put("KW", "{\"name\":\"KUWAIT\",\"fmt\":\"%N%n%O%n%A%n%Z %C\"}");
     map.put("KY", "{\"name\":\"CAYMAN ISLANDS\",\"lang\":\"en\",\"languages\":\"en\",\"fmt\":\"%N%n%O%n%A%n%S %Z\",\"require\":\"AS\",\"state_name_type\":\"island\"}");
@@ -184,12 +186,12 @@
     map.put("MW", "{\"name\":\"MALAWI\",\"fmt\":\"%N%n%O%n%A%n%C %X\"}");
     map.put("MX", "{\"name\":\"MEXICO\",\"lang\":\"es\",\"languages\":\"es\",\"fmt\":\"%N%n%O%n%A%n%D%n%Z %C, %S\",\"require\":\"ACZ\",\"upper\":\"CSZ\",\"sublocality_name_type\":\"neighborhood\",\"state_name_type\":\"state\",\"width_overrides\":\"%S:S\",\"label_overrides\":[{\"field\":\"S1\",\"label\":\"Delegación\"},{\"field\":\"S2\",\"label\":\"Supermanzana\"},{\"field\":\"S3\",\"label\":\"Manzana\"},{\"field\":\"LP\",\"label\":\"Lote\"}]}");
     map.put("MY", "{\"name\":\"MALAYSIA\",\"lang\":\"ms\",\"languages\":\"ms\",\"fmt\":\"%N%n%O%n%A%n%D%n%Z %C%n%S\",\"require\":\"ACZ\",\"upper\":\"CS\",\"sublocality_name_type\":\"village_township\",\"state_name_type\":\"state\"}");
-    map.put("MZ", "{\"name\":\"MOZAMBIQUE\",\"fmt\":\"%N%n%O%n%A%n%Z %C\"}");
+    map.put("MZ", "{\"name\":\"MOZAMBIQUE\",\"lang\":\"pt\",\"languages\":\"pt\",\"fmt\":\"%N%n%O%n%A%n%Z %C%S\"}");
     map.put("NA", "{\"name\":\"NAMIBIA\"}");
     map.put("NC", "{\"name\":\"NEW CALEDONIA\",\"fmt\":\"%O%n%N%n%A%n%Z %C %X\",\"require\":\"ACZ\",\"upper\":\"ACX\"}");
     map.put("NE", "{\"name\":\"NIGER\",\"fmt\":\"%N%n%O%n%A%n%Z %C\"}");
     map.put("NF", "{\"name\":\"NORFOLK ISLAND\",\"fmt\":\"%O%n%N%n%A%n%C %S %Z\",\"upper\":\"CS\"}");
-    map.put("NG", "{\"name\":\"NIGERIA\",\"lang\":\"en\",\"languages\":\"en\",\"fmt\":\"%N%n%O%n%A%n%D%n%C %Z%n%S\",\"upper\":\"CS\",\"state_name_type\":\"state\"}");
+    map.put("NG", "{\"name\":\"NIGERIA\",\"lang\":\"en\",\"languages\":\"en\",\"fmt\":\"%N%n%O%n%A%n%D%n%C %Z%n%S\",\"upper\":\"CS\",\"state_name_type\":\"state\",\"label_overrides\":[{\"field\":\"D\",\"label\":\"Local government area\",\"lang\":\"en\"}]}");
     map.put("NI", "{\"name\":\"NICARAGUA\",\"lang\":\"es\",\"languages\":\"es\",\"fmt\":\"%N%n%O%n%A%n%Z%n%C, %S\",\"upper\":\"CS\",\"state_name_type\":\"department\"}");
     map.put("NL", "{\"name\":\"NETHERLANDS\",\"fmt\":\"%O%n%N%n%A%n%Z %C\",\"require\":\"ACZ\"}");
     map.put("NO", "{\"name\":\"NORWAY\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\",\"locality_name_type\":\"post_town\"}");
@@ -207,7 +209,7 @@
     map.put("PL", "{\"name\":\"POLAND\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\"}");
     map.put("PM", "{\"name\":\"ST. PIERRE AND MIQUELON\",\"fmt\":\"%O%n%N%n%A%n%Z %C %X\",\"require\":\"ACZ\",\"upper\":\"ACX\"}");
     map.put("PN", "{\"name\":\"PITCAIRN\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"require\":\"ACZ\",\"upper\":\"CZ\"}");
-    map.put("PR", "{\"name\":\"PUERTO RICO\",\"fmt\":\"%N%n%O%n%A%n%C PR %Z\",\"require\":\"ACZ\",\"upper\":\"ACNO\",\"zip_name_type\":\"zip\",\"postprefix\":\"PR\"}");
+    map.put("PR", "{\"name\":\"PUERTO RICO\",\"fmt\":\"%N%n%O%n%A%n%C PR %Z\",\"require\":\"ACZ\",\"upper\":\"ACNO\",\"zip_name_type\":\"zip\",\"postprefix\":\"PR \"}");
     map.put("PS", "{\"name\":\"PALESTINIAN TERRITORY\"}");
     map.put("PT", "{\"name\":\"PORTUGAL\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\"}");
     map.put("PW", "{\"name\":\"PALAU\",\"fmt\":\"%N%n%O%n%A%n%C %S %Z\",\"require\":\"ACSZ\",\"upper\":\"ACNOS\",\"state_name_type\":\"state\",\"zip_name_type\":\"zip\"}");
@@ -221,12 +223,13 @@
     map.put("SA", "{\"name\":\"SAUDI ARABIA\",\"fmt\":\"%N%n%O%n%A%n%C %Z\"}");
     map.put("SB", "{\"name\":\"SOLOMON ISLANDS\"}");
     map.put("SC", "{\"name\":\"SEYCHELLES\",\"fmt\":\"%N%n%O%n%A%n%C%n%S\",\"upper\":\"S\",\"state_name_type\":\"island\"}");
+    map.put("SD", "{\"name\":\"SUDAN\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"locality_name_type\":\"district\"}");
     map.put("SE", "{\"name\":\"SWEDEN\",\"fmt\":\"%O%n%N%n%A%nSE-%Z %C\",\"require\":\"ACZ\",\"locality_name_type\":\"post_town\",\"postprefix\":\"SE-\"}");
     map.put("SG", "{\"name\":\"REP. OF SINGAPORE\",\"fmt\":\"%N%n%O%n%A%nSINGAPORE %Z\",\"require\":\"AZ\"}");
     map.put("SH", "{\"name\":\"SAINT HELENA\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"require\":\"ACZ\",\"upper\":\"CZ\"}");
-    map.put("SI", "{\"name\":\"SLOVENIA\",\"fmt\":\"%N%n%O%n%A%nSI- %Z %C\",\"postprefix\":\"SI-\"}");
+    map.put("SI", "{\"name\":\"SLOVENIA\",\"fmt\":\"%N%n%O%n%A%nSI-%Z %C\",\"postprefix\":\"SI-\"}");
     map.put("SJ", "{\"name\":\"SVALBARD AND JAN MAYEN ISLANDS\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\",\"locality_name_type\":\"post_town\"}");
-    map.put("SK", "{\"name\":\"SLOVAKIA\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"label_overrides\":[{\"field\":\"NH\",\"label\":\"Obecní část\",\"lang\":\"cs\"},{\"field\":\"NH\",\"label\":\"Obecný časť\",\"lang\":\"sk\"},{\"field\":\"BI\",\"label\":\"Descriptive No.\"},{\"field\":\"BI\",\"label\":\"Popisné číslo\",\"lang\":\"cs\"},{\"field\":\"BI\",\"label\":\"Súpisné číslo\",\"lang\":\"sk\"},{\"field\":\"SN\",\"label\":\"Orientation No.\"},{\"field\":\"SN\",\"label\":\"Orientační číslo\",\"lang\":\"cs\"},{\"field\":\"SN\",\"label\":\"Orientačné číslo\",\"lang\":\"sk\"},{\"field\":\"S1\",\"label\":\"City District\"},{\"field\":\"S1\",\"label\":\"Městská část\",\"lang\":\"cs\"},{\"field\":\"S1\",\"label\":\"Mestská časť\",\"lang\":\"sk\"}]}");
+    map.put("SK", "{\"name\":\"SLOVAKIA\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"ACZ\",\"label_overrides\":[{\"field\":\"NH\",\"label\":\"Obecní část\",\"lang\":\"cs\"},{\"field\":\"NH\",\"label\":\"Obecný časť\",\"lang\":\"sk\"},{\"field\":\"BI\",\"label\":\"Descriptive No.\"},{\"field\":\"BI\",\"label\":\"Popisné číslo\",\"lang\":\"cs\"},{\"field\":\"BI\",\"label\":\"Súpisné číslo\",\"lang\":\"sk\"},{\"field\":\"SN\",\"label\":\"Orientation No.\"},{\"field\":\"SN\",\"label\":\"Orientační číslo\",\"lang\":\"cs\"},{\"field\":\"SN\",\"label\":\"Orientačné číslo\",\"lang\":\"sk\"},{\"field\":\"S1\",\"label\":\"City District\"},{\"field\":\"S1\",\"label\":\"Městská část\",\"lang\":\"cs\"},{\"field\":\"S1\",\"label\":\"Mestská časť\",\"lang\":\"sk\"}]}");
     map.put("SL", "{\"name\":\"SIERRA LEONE\"}");
     map.put("SM", "{\"name\":\"SAN MARINO\",\"fmt\":\"%N%n%O%n%A%n%Z %C\",\"require\":\"AZ\"}");
     map.put("SN", "{\"name\":\"SENEGAL\",\"fmt\":\"%N%n%O%n%A%n%Z %C\"}");
@@ -236,6 +239,7 @@
     map.put("ST", "{\"name\":\"SAO TOME AND PRINCIPE\"}");
     map.put("SV", "{\"name\":\"EL SALVADOR\",\"lang\":\"es\",\"languages\":\"es\",\"fmt\":\"%N%n%O%n%A%n%Z-%C%n%S\",\"require\":\"ACS\",\"upper\":\"CSZ\"}");
     map.put("SX", "{\"name\":\"SINT MAARTEN\"}");
+    map.put("SY", "{\"name\":\"SYRIA\"}");
     map.put("SZ", "{\"name\":\"SWAZILAND\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"upper\":\"ACZ\"}");
     map.put("TA", "{\"name\":\"TRISTAN DA CUNHA\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\"}");
     map.put("TC", "{\"name\":\"TURKS AND CAICOS ISLANDS\",\"fmt\":\"%N%n%O%n%A%n%C%n%Z\",\"require\":\"ACZ\",\"upper\":\"CZ\"}");
diff --git a/common/src/main/java/com/google/i18n/addressinput/common/StandardAddressVerifier.java b/common/src/main/java/com/google/i18n/addressinput/common/StandardAddressVerifier.java
index b9b3fda..8eb3693 100644
--- a/common/src/main/java/com/google/i18n/addressinput/common/StandardAddressVerifier.java
+++ b/common/src/main/java/com/google/i18n/addressinput/common/StandardAddressVerifier.java
@@ -69,13 +69,7 @@
    * Verifies the address, reporting problems to problems.
    */
   public void verify(AddressData address, AddressProblems problems) {
-    NotifyingListener listener = new NotifyingListener();
-    verifyAsync(address, problems, listener);
-    try {
-      listener.waitLoadingEnd();
-    } catch (InterruptedException e) {
-      throw new RuntimeException(e);
-    }
+    new Verifier(address, problems, new NotifyingListener()).run();
   }
 
   public void verifyAsync(
diff --git a/common/src/test/java/com/google/i18n/addressinput/common/FieldVerifierTest.java b/common/src/test/java/com/google/i18n/addressinput/common/FieldVerifierTest.java
index 399300b..57e86d8 100644
--- a/common/src/test/java/com/google/i18n/addressinput/common/FieldVerifierTest.java
+++ b/common/src/test/java/com/google/i18n/addressinput/common/FieldVerifierTest.java
@@ -346,9 +346,8 @@
     AddressProblems problems = new AddressProblems();
     AddressData address = AddressData.builder()
         .setRecipient("\u5BAE\u672C \u8302")  // SHIGERU_MIYAMOTO
-        .setAddress("\u4E0A\u9CE5\u7FBD\u927E\u7ACB\u753A11\u756A\u5730")
+        .setAddress("\u4EAC\u90FD\u5E02\u4E0A\u9CE5\u7FBD\u927E\u7ACB\u753A11\u756A\u5730")
         .setAdminArea("\u4eac\u90fd\u5e9c")  // Kyoto prefecture
-        .setLocality("\u4EAC\u90FD\u5E02")  // Kyoto city
         .setCountry("JP")
         .setPostalCode("601-8501")
         .build();
@@ -360,9 +359,8 @@
     AddressProblems problems = new AddressProblems();
     AddressData address = AddressData.builder()
         .setRecipient("Shigeru Miyamoto")
-        .setAddress("11-1 Kamitoba-hokotate-cho")
+        .setAddress("11-1 Kamitoba-hokotate-cho Kyoto")
         .setAdminArea("KYOTO")
-        .setLocality("Kyoto")
         .setLanguageCode("ja_Latn")
         .setCountry("JP")
         .setPostalCode("601-8501")
@@ -375,7 +373,7 @@
     AddressProblems problems = new AddressProblems();
     AddressData address = AddressData.builder()
         .setRecipient("Shigeru Miyamoto")  // SHIGERU_MIYAMOTO_ENGLISH
-        .setAddress("11-1 Kamitoba-hokotate-cho")
+        .setAddress("11-1 Kamitoba-hokotate-cho Kyoto")
         .setAdminArea("Fake Admin")
         .setLocality("Kyoto")
         .setLanguageCode("ja_Latn")
diff --git a/common/src/test/java/com/google/i18n/addressinput/common/StandardAddressVerifierTest.java b/common/src/test/java/com/google/i18n/addressinput/common/StandardAddressVerifierTest.java
index 32e8e79..302e211 100644
--- a/common/src/test/java/com/google/i18n/addressinput/common/StandardAddressVerifierTest.java
+++ b/common/src/test/java/com/google/i18n/addressinput/common/StandardAddressVerifierTest.java
@@ -32,13 +32,12 @@
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 @RunWith(JUnit4.class)
 public class StandardAddressVerifierTest {
@@ -138,6 +137,61 @@
         problems.getProblems());
   }
 
+  @Test
+  public void testHongKongAddress_withMultipleLanguageCombination() {
+    //
+    // With values in English...
+    //
+    AddressData address =
+        AddressData.builder()
+            .setCountry("HK")
+            .setAdminArea("Kowloon")
+            .setLocality("Tsim Sha Tsui")
+            .setAddress("Salisbury Road")
+            .build();
+
+    // Verify that with no language code set, no errors.
+    assertThat(verify(address).getProblems()).isEmpty();
+
+    // Verify that with an invalid language code, admin area is not found.
+    address = AddressData.builder().set(address).setLanguageCode("").build();
+    assertEquals(ImmutableMap.of(ADMIN_AREA, UNKNOWN_VALUE), verify(address).getProblems());
+
+    // Verify that with language set to English, no errors.
+    address = AddressData.builder().set(address).setLanguageCode("en").build();
+    assertThat(verify(address).getProblems()).isEmpty();
+
+    // Verify that with language set to Chinese, admin area is not found.
+    address = AddressData.builder().set(address).setLanguageCode("zh-Hant").build();
+    assertEquals(ImmutableMap.of(ADMIN_AREA, UNKNOWN_VALUE), verify(address).getProblems());
+
+    //
+    // With values in Chinese...
+    //
+    address =
+        AddressData.builder()
+            .setCountry("HK")
+            .setAdminArea("九龍")
+            .setLocality("尖沙咀")
+            .setAddress("Salisbury Road")
+            .build();
+
+    // Verify that with no language code set, no errors.
+    assertThat(verify(address).getProblems()).isEmpty();
+
+    // Verify that with an invalid language code, no errors (assume default language).
+    address = AddressData.builder().set(address).setLanguageCode("").build();
+    assertThat(verify(address).getProblems()).isEmpty();
+
+    // Verify that with language set to English, admin area is not found.
+    address = AddressData.builder().set(address).setLanguageCode("en").build();
+    assertEquals(ImmutableMap.of(ADMIN_AREA, UNKNOWN_VALUE), verify(address).getProblems());
+
+    // Verify that with language set to Chinese, no errors.
+    address = AddressData.builder().set(address).setLanguageCode("zh-Hant").build();
+    assertThat(verify(address).getProblems()).isEmpty();
+  }
+
   @Test public void testChinaAddress() {
     AddressData address = AddressData.builder()
         .setCountry("CN")
@@ -210,9 +264,9 @@
   @Test public void testJapanAddress() {
     AddressData address = AddressData.builder()
         .setRecipient("\u5BAE\u672C \u8302")  // SHIGERU_MIYAMOTO
-        .setAddress("\u4E0A\u9CE5\u7FBD\u927E\u7ACB\u753A11\u756A\u5730")
+        // Kyoto city Kamitoba-hokotate-cho 11
+        .setAddress("\u4EAC\u90FD\u5E02 \u4E0A\u9CE5\u7FBD\u927E\u7ACB\u753A11\u756A\u5730")
         .setAdminArea("\u4eac\u90fd\u5e9c")  // Kyoto prefecture
-        .setLocality("\u4EAC\u90FD\u5E02")  // Kyoto city
         .setCountry("JP")
         .setPostalCode("601-8501")
         .build();
@@ -222,9 +276,8 @@
   @Test public void testJapanAddress_Latin() {
     AddressData address = AddressData.builder()
         .setRecipient("Shigeru Miyamoto")
-        .setAddress("11-1 Kamitoba-hokotate-cho")
+        .setAddress("11-1 Kamitoba-hokotate-cho\nKyoto")
         .setAdminArea("KYOTO")  // Kyoto prefecture
-        .setLocality("Kyoto")  // Kyoto city
         .setLanguageCode("ja_Latn")
         .setCountry("JP")
         .setPostalCode("601-8501")
diff --git a/cpp/include/libaddressinput/address_problem.h b/cpp/include/libaddressinput/address_problem.h
index 743b9e8..e8f937b 100644
--- a/cpp/include/libaddressinput/address_problem.h
+++ b/cpp/include/libaddressinput/address_problem.h
@@ -38,7 +38,7 @@
   UNKNOWN_VALUE,
 
   // A format for the field is defined and the value does not match. This is
-  // used to match POSTAL_CODE against the the format pattern generally. Formats
+  // used to match POSTAL_CODE against the format pattern generally. Formats
   // indicate how many digits/letters should be present, and what punctuation is
   // allowed. For example, in the U.S. postal codes are five digits with an
   // optional hyphen followed by four digits.
diff --git a/cpp/include/libaddressinput/address_validator.h b/cpp/include/libaddressinput/address_validator.h
index 7c786d5..f8efb96 100644
--- a/cpp/include/libaddressinput/address_validator.h
+++ b/cpp/include/libaddressinput/address_validator.h
@@ -31,7 +31,7 @@
 class Supplier;
 struct AddressData;
 
-typedef std::multimap<AddressField, AddressProblem> FieldProblemMap;
+using FieldProblemMap = std::multimap<AddressField, AddressProblem>;
 
 // Validates an AddressData struct. Sample usage:
 //    class MyClass {
@@ -67,8 +67,8 @@
 //    };
 class AddressValidator {
  public:
-  typedef i18n::addressinput::Callback<const AddressData&,
-                                       const FieldProblemMap&> Callback;
+  using Callback =
+      i18n::addressinput::Callback<const AddressData&, const FieldProblemMap&>;
 
   AddressValidator(const AddressValidator&) = delete;
   AddressValidator& operator=(const AddressValidator&) = delete;
diff --git a/cpp/include/libaddressinput/callback.h b/cpp/include/libaddressinput/callback.h
index 57117c6..67ea309 100644
--- a/cpp/include/libaddressinput/callback.h
+++ b/cpp/include/libaddressinput/callback.h
@@ -29,7 +29,7 @@
 // Stores a pointer to a method in an object. Sample usage:
 //    class MyClass {
 //     public:
-//      typedef Callback<const MyType&, const MyDataType&> MyCallback;
+//      using MyCallback = Callback<const MyType&, const MyDataType&>;
 //
 //      void GetDataAsynchronously() {
 //        std::unique_ptr<MyCallback> callback(BuildCallback(
@@ -49,7 +49,7 @@
 template <typename Key, typename Data>
 class Callback {
  public:
-  virtual ~Callback() {}
+  virtual ~Callback() = default;
   virtual void operator()(bool success, Key key, Data data) const = 0;
 };
 
@@ -58,7 +58,7 @@
 template <typename Observer, typename Key, typename Data>
 class CallbackImpl : public Callback<Key, Data> {
  public:
-  typedef void (Observer::*ObserveEvent)(bool, Key, Data);
+  using ObserveEvent = void (Observer::*)(bool, Key, Data);
 
   CallbackImpl(Observer* observer, ObserveEvent observe_event)
       : observer_(observer),
@@ -67,7 +67,7 @@
     assert(observe_event_ != nullptr);
   }
 
-  ~CallbackImpl() override {}
+  ~CallbackImpl() override = default;
 
   void operator()(bool success, Key key, Data data) const override {
     (observer_->*observe_event_)(success, key, data);
diff --git a/cpp/include/libaddressinput/preload_supplier.h b/cpp/include/libaddressinput/preload_supplier.h
index 50309ae..3a5b1f5 100644
--- a/cpp/include/libaddressinput/preload_supplier.h
+++ b/cpp/include/libaddressinput/preload_supplier.h
@@ -49,7 +49,7 @@
 // in total less than 2 MB of JSON data.)
 class PreloadSupplier : public Supplier {
  public:
-  typedef i18n::addressinput::Callback<const std::string&, int> Callback;
+  using Callback = i18n::addressinput::Callback<const std::string&, int>;
 
   PreloadSupplier(const PreloadSupplier&) = delete;
   PreloadSupplier& operator=(const PreloadSupplier&) = delete;
diff --git a/cpp/include/libaddressinput/region_data_builder.h b/cpp/include/libaddressinput/region_data_builder.h
index 8aa9a3e..61e89a6 100644
--- a/cpp/include/libaddressinput/region_data_builder.h
+++ b/cpp/include/libaddressinput/region_data_builder.h
@@ -66,8 +66,8 @@
                           std::string* best_region_tree_language_tag);
 
  private:
-  typedef std::map<std::string, const RegionData*> LanguageRegionMap;
-  typedef std::map<std::string, LanguageRegionMap*> RegionCodeDataMap;
+  using LanguageRegionMap = std::map<std::string, const RegionData*>;
+  using RegionCodeDataMap = std::map<std::string, LanguageRegionMap*>;
 
   PreloadSupplier* const supplier_;  // Not owned.
   RegionCodeDataMap cache_;
diff --git a/cpp/include/libaddressinput/source.h b/cpp/include/libaddressinput/source.h
index 4d91b68..96aefb5 100644
--- a/cpp/include/libaddressinput/source.h
+++ b/cpp/include/libaddressinput/source.h
@@ -40,10 +40,10 @@
 //    };
 class Source {
  public:
-  typedef i18n::addressinput::Callback<const std::string&,
-                                       std::string*> Callback;
+  using Callback =
+      i18n::addressinput::Callback<const std::string&, std::string*>;
 
-  virtual ~Source() {}
+  virtual ~Source() = default;
 
   // Gets metadata for |key| and invokes the |data_ready| callback.
   virtual void Get(const std::string& key,
diff --git a/cpp/include/libaddressinput/storage.h b/cpp/include/libaddressinput/storage.h
index 94ad13b..3e0dd7d 100644
--- a/cpp/include/libaddressinput/storage.h
+++ b/cpp/include/libaddressinput/storage.h
@@ -44,10 +44,10 @@
 //    };
 class Storage {
  public:
-  typedef i18n::addressinput::Callback<const std::string&,
-                                       std::string*> Callback;
+  using Callback =
+      i18n::addressinput::Callback<const std::string&, std::string*>;
 
-  virtual ~Storage() {}
+  virtual ~Storage() = default;
 
   // Stores |data| for |key|, where |data| is an object allocated on the heap,
   // which Storage takes ownership of.
diff --git a/cpp/include/libaddressinput/supplier.h b/cpp/include/libaddressinput/supplier.h
index b7d1da2..24f683d 100644
--- a/cpp/include/libaddressinput/supplier.h
+++ b/cpp/include/libaddressinput/supplier.h
@@ -28,10 +28,10 @@
 class Supplier {
  public:
   struct RuleHierarchy;
-  typedef i18n::addressinput::Callback<const LookupKey&,
-                                       const RuleHierarchy&> Callback;
+  using Callback =
+      i18n::addressinput::Callback<const LookupKey&, const RuleHierarchy&>;
 
-  virtual ~Supplier() {}
+  virtual ~Supplier() = default;
 
   // Aggregates the metadata needed for |lookup_key| into a RuleHierarchy
   // object, then calls |supplied|. Implementations of this interface may
diff --git a/cpp/src/address_data.cc b/cpp/src/address_data.cc
index 80f4d56..388d7a7 100644
--- a/cpp/src/address_data.cc
+++ b/cpp/src/address_data.cc
@@ -35,28 +35,28 @@
 
 // Mapping from AddressField value to pointer to AddressData member.
 std::string AddressData::*kStringField[] = {
-  &AddressData::region_code,
-  &AddressData::administrative_area,
-  &AddressData::locality,
-  &AddressData::dependent_locality,
-  &AddressData::sorting_code,
-  &AddressData::postal_code,
-  nullptr,
-  &AddressData::organization,
-  &AddressData::recipient
+    &AddressData::region_code,
+    &AddressData::administrative_area,
+    &AddressData::locality,
+    &AddressData::dependent_locality,
+    &AddressData::sorting_code,
+    &AddressData::postal_code,
+    nullptr,
+    &AddressData::organization,
+    &AddressData::recipient,
 };
 
 // Mapping from AddressField value to pointer to AddressData member.
 const std::vector<std::string> AddressData::*kVectorStringField[] = {
-  nullptr,
-  nullptr,
-  nullptr,
-  nullptr,
-  nullptr,
-  nullptr,
-  &AddressData::address_line,
-  nullptr,
-  nullptr
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    &AddressData::address_line,
+    nullptr,
+    nullptr,
 };
 
 static_assert(size(kStringField) == size(kVectorStringField),
@@ -75,18 +75,17 @@
   assert(field >= 0);
   assert(static_cast<size_t>(field) < size(kStringField));
   if (kStringField[field] != nullptr) {
-    const std::string& value = GetFieldValue(field);
+    const auto& value = GetFieldValue(field);
     return IsStringEmpty(value);
   } else {
-    const std::vector<std::string>& value = GetRepeatedFieldValue(field);
+    const auto& value = GetRepeatedFieldValue(field);
     return std::find_if(value.begin(),
                         value.end(),
                         std::not1(std::ptr_fun(&IsStringEmpty))) == value.end();
   }
 }
 
-const std::string& AddressData::GetFieldValue(
-    AddressField field) const {
+const std::string& AddressData::GetFieldValue(AddressField field) const {
   assert(field >= 0);
   assert(static_cast<size_t>(field) < size(kStringField));
   assert(kStringField[field] != nullptr);
@@ -140,10 +139,8 @@
 
   // TODO: Update the field order in the .h file to match the order they are
   // printed out here, for consistency.
-  for (std::vector<std::string>::const_iterator it =
-           address.address_line.begin();
-       it != address.address_line.end(); ++it) {
-    o << "address_line: \"" << *it << "\"\n";
+  for (const auto& line : address.address_line) {
+    o << "address_line: \"" << line << "\"\n";
   }
 
   o << "language_code: \"" << address.language_code << "\"\n"
diff --git a/cpp/src/address_field.cc b/cpp/src/address_field.cc
index fe279c4..9ac57b3 100644
--- a/cpp/src/address_field.cc
+++ b/cpp/src/address_field.cc
@@ -26,15 +26,15 @@
 
 std::ostream& operator<<(std::ostream& o, AddressField field) {
   static const char* const kFieldNames[] = {
-    "COUNTRY",
-    "ADMIN_AREA",
-    "LOCALITY",
-    "DEPENDENT_LOCALITY",
-    "SORTING_CODE",
-    "POSTAL_CODE",
-    "STREET_ADDRESS",
-    "ORGANIZATION",
-    "RECIPIENT"
+      "COUNTRY",
+      "ADMIN_AREA",
+      "LOCALITY",
+      "DEPENDENT_LOCALITY",
+      "SORTING_CODE",
+      "POSTAL_CODE",
+      "STREET_ADDRESS",
+      "ORGANIZATION",
+      "RECIPIENT",
   };
   static_assert(COUNTRY == 0, "bad_base");
   static_assert(RECIPIENT == size(kFieldNames) - 1, "bad_length");
diff --git a/cpp/src/address_field_util.cc b/cpp/src/address_field_util.cc
index 550e4bf..1c62fd3 100644
--- a/cpp/src/address_field_util.cc
+++ b/cpp/src/address_field_util.cc
@@ -18,12 +18,10 @@
 
 #include <algorithm>
 #include <cassert>
-#include <cstddef>
 #include <string>
 #include <vector>
 
 #include "format_element.h"
-#include "util/size.h"
 
 namespace i18n {
 namespace addressinput {
@@ -37,24 +35,23 @@
   assert(field != nullptr);
 
   // Simple mapping from field token characters to AddressField values.
-  static const struct Entry { char ch; AddressField field; } kTokenMap[] = {
-    { 'R', COUNTRY },
-    { 'S', ADMIN_AREA },
-    { 'C', LOCALITY },
-    { 'D', DEPENDENT_LOCALITY },
-    { 'X', SORTING_CODE },
-    { 'Z', POSTAL_CODE },
-    { 'A', STREET_ADDRESS },
-    { 'O', ORGANIZATION },
-    { 'N', RECIPIENT },
+  static const struct { char c; AddressField field; } kTokenMap[] = {
+      { 'R', COUNTRY },
+      { 'S', ADMIN_AREA },
+      { 'C', LOCALITY },
+      { 'D', DEPENDENT_LOCALITY },
+      { 'X', SORTING_CODE },
+      { 'Z', POSTAL_CODE },
+      { 'A', STREET_ADDRESS },
+      { 'O', ORGANIZATION },
+      { 'N', RECIPIENT },
   };
-  const size_t kTokenMapSize = size(kTokenMap);
 
-  for (size_t n = 0; n < kTokenMapSize; ++n) {
-      if (c == kTokenMap[n].ch) {
-          *field = kTokenMap[n].field;
-          return true;
-      }
+  for (const auto& entry : kTokenMap) {
+    if (c == entry.c) {
+      *field = entry.field;
+      return true;
+    }
   }
   return false;
 }
@@ -101,10 +98,9 @@
                                 std::vector<AddressField>* fields) {
   assert(fields != nullptr);
   fields->clear();
-  for (std::string::const_iterator it = required.begin();
-       it != required.end(); ++it) {
+  for (char c : required) {
     AddressField field;
-    if (ParseFieldToken(*it, &field)) {
+    if (ParseFieldToken(c, &field)) {
       fields->push_back(field);
     }
   }
diff --git a/cpp/src/address_formatter.cc b/cpp/src/address_formatter.cc
index a1f673f..7dc6be8 100644
--- a/cpp/src/address_formatter.cc
+++ b/cpp/src/address_formatter.cc
@@ -41,13 +41,13 @@
 const char kArabicCommaSeparator[] = u8"، ";
 
 const char* kLanguagesThatUseSpace[] = {
-  "th",
-  "ko"
+    "th",
+    "ko",
 };
 
 const char* kLanguagesThatHaveNoSeparator[] = {
-  "ja",
-  "zh"  // All Chinese variants.
+    "ja",
+    "zh",  // All Chinese variants.
 };
 
 // This data is based on CLDR, for languages that are in official use in some
@@ -55,17 +55,17 @@
 // TODO: Consider supporting variants such as tr-Arab by detecting the script
 // code.
 const char* kLanguagesThatUseAnArabicComma[] = {
-  "ar",
-  "az",
-  "fa",
-  "kk",
-  "ku",
-  "ky",
-  "ps",
-  "tg",
-  "tk",
-  "ur",
-  "uz"
+    "ar",
+    "az",
+    "fa",
+    "kk",
+    "ku",
+    "ky",
+    "ps",
+    "tg",
+    "tk",
+    "ur",
+    "uz",
 };
 
 std::string GetLineSeparatorForLanguage(const std::string& language_tag) {
@@ -113,9 +113,7 @@
                              std::string* line) {
   line->clear();
   std::string separator = GetLineSeparatorForLanguage(language_tag);
-  for (std::vector<std::string>::const_iterator it = lines.begin();
-       it != lines.end();
-       ++it) {
+  for (auto it = lines.begin(); it != lines.end(); ++it) {
     if (it != lines.begin()) {
       line->append(separator);
     }
@@ -134,8 +132,8 @@
   rule.CopyFrom(Rule::GetDefault());
   // TODO: Eventually, we should get the best rule for this country and
   // language, rather than just for the country.
-  rule.ParseSerializedRule(RegionDataConstants::GetRegionData(
-      address_data.region_code));
+  rule.ParseSerializedRule(
+      RegionDataConstants::GetRegionData(address_data.region_code));
 
   Language language(address_data.language_code);
 
@@ -153,8 +151,7 @@
   // surrounding fields are filled in. This works with the data we have
   // currently.
   std::vector<FormatElement> pruned_format;
-  for (std::vector<FormatElement>::const_iterator
-       element_it = format.begin();
+  for (auto element_it = format.begin();
        element_it != format.end();
        ++element_it) {
     // Always keep the newlines.
@@ -177,17 +174,14 @@
   }
 
   std::string line;
-  for (std::vector<FormatElement>::const_iterator
-       element_it = pruned_format.begin();
-       element_it != pruned_format.end();
-       ++element_it) {
-    if (element_it->IsNewline()) {
+  for (const auto& element : pruned_format) {
+    if (element.IsNewline()) {
       if (!line.empty()) {
         lines->push_back(line);
         line.clear();
       }
-    } else if (element_it->IsField()) {
-      AddressField field = element_it->GetField();
+    } else if (element.IsField()) {
+      AddressField field = element.GetField();
       if (field == STREET_ADDRESS) {
         // The field "street address" represents the street address lines of an
         // address, so there can be multiple values.
@@ -205,7 +199,7 @@
         line.append(address_data.GetFieldValue(field));
       }
     } else {
-      line.append(element_it->GetLiteral());
+      line.append(element.GetLiteral());
     }
   }
   if (!line.empty()) {
diff --git a/cpp/src/address_input_helper.cc b/cpp/src/address_input_helper.cc
index 2bd3308..6a7a583 100644
--- a/cpp/src/address_input_helper.cc
+++ b/cpp/src/address_input_helper.cc
@@ -103,8 +103,7 @@
   assert(supplier_ != nullptr);
 }
 
-AddressInputHelper::~AddressInputHelper() {
-}
+AddressInputHelper::~AddressInputHelper() = default;
 
 void AddressInputHelper::FillAddress(AddressData* address) const {
   assert(address != nullptr);
@@ -136,7 +135,6 @@
     // have been added in the previous check.
     if (!address->postal_code.empty() &&
         RE2::FullMatch(address->postal_code, *postal_code_reg_exp->ptr)) {
-
       // This hierarchy is used to store rules that represent possible matches
       // at each level of the hierarchy.
       std::vector<Node> hierarchy[kHierarchyDepth];
@@ -166,7 +164,7 @@
     assert(depth < size(LookupKey::kHierarchy));
 
     // This was a match, so store it and its parent in the hierarchy.
-    hierarchy[depth].push_back(Node());
+    hierarchy[depth].emplace_back();
     Node* node = &hierarchy[depth].back();
     node->parent = parent;
     node->rule = rule;
@@ -174,11 +172,9 @@
     if (depth < size(LookupKey::kHierarchy) - 1 &&
         IsFieldUsed(LookupKey::kHierarchy[depth + 1], address.region_code)) {
       // If children are used and present, check them too.
-      for (std::vector<std::string>::const_iterator child_it =
-               rule->GetSubKeys().begin();
-           child_it != rule->GetSubKeys().end(); ++child_it) {
+      for (const auto& sub_key : rule->GetSubKeys()) {
         LookupKey child_key;
-        child_key.FromLookupKey(lookup_key, *child_it);
+        child_key.FromLookupKey(lookup_key, sub_key);
         CheckChildrenForPostCodeMatches(address, child_key, node, hierarchy);
       }
     }
diff --git a/cpp/src/address_normalizer.cc b/cpp/src/address_normalizer.cc
index 0dcd55e..12a7cd7 100644
--- a/cpp/src/address_normalizer.cc
+++ b/cpp/src/address_normalizer.cc
@@ -37,7 +37,7 @@
   assert(supplier_ != nullptr);
 }
 
-AddressNormalizer::~AddressNormalizer() {}
+AddressNormalizer::~AddressNormalizer() = default;
 
 void AddressNormalizer::Normalize(AddressData* address) const {
   assert(address != nullptr);
@@ -55,12 +55,11 @@
   std::vector<std::string> languages(parent_rule->GetLanguages());
 
   if (languages.empty()) {
-    languages.push_back("");
+    languages.emplace_back("");
   } else {
     languages[0] = "";  // The default language doesn't need a tag on the id.
   }
 
-
   LookupKey lookup_key;
   for (size_t depth = 1; depth < size(LookupKey::kHierarchy); ++depth) {
     AddressField field = LookupKey::kHierarchy[depth];
@@ -70,18 +69,16 @@
     const std::string& field_value = address->GetFieldValue(field);
     bool no_match_found_yet = true;
 
-    const std::vector<std::string>& sub_keys = parent_rule->GetSubKeys();
-
-    for (size_t i = 0; i < sub_keys.size(); i++) {
-      const std::string& sub_key = sub_keys[i];
-      if (!no_match_found_yet)
+    for (const auto& sub_key : parent_rule->GetSubKeys()) {
+      if (!no_match_found_yet) {
         break;
-      for (const std::string& language : languages) {
-        lookup_key.set_language(language);
+      }
+      for (const std::string& language_tag : languages) {
+        lookup_key.set_language(language_tag);
         lookup_key.FromLookupKey(parent_key, sub_key);
         const Rule* rule = supplier_->GetRule(lookup_key);
 
-        // A rule with key = |subkey| and specified |language| was expected to
+        // A rule with key = sub_key and specified language_tag was expected to
         // be found in a certain format (e.g. data/CA/QC--fr), but it was not.
         // This is due to a possible inconsistency in the data format.
         if (rule == nullptr) continue;
diff --git a/cpp/src/address_problem.cc b/cpp/src/address_problem.cc
index b5fc560..42a8868 100644
--- a/cpp/src/address_problem.cc
+++ b/cpp/src/address_problem.cc
@@ -20,18 +20,18 @@
 #include "util/size.h"
 
 using i18n::addressinput::AddressProblem;
+using i18n::addressinput::size;
 using i18n::addressinput::UNEXPECTED_FIELD;
 using i18n::addressinput::USES_P_O_BOX;
-using i18n::addressinput::size;
 
 std::ostream& operator<<(std::ostream& o, AddressProblem problem) {
   static const char* const kProblemNames[] = {
-    "UNEXPECTED_FIELD",
-    "MISSING_REQUIRED_FIELD",
-    "UNKNOWN_VALUE",
-    "INVALID_FORMAT",
-    "MISMATCHING_VALUE",
-    "USES_P_O_BOX"
+      "UNEXPECTED_FIELD",
+      "MISSING_REQUIRED_FIELD",
+      "UNKNOWN_VALUE",
+      "INVALID_FORMAT",
+      "MISMATCHING_VALUE",
+      "USES_P_O_BOX",
   };
   static_assert(UNEXPECTED_FIELD == 0, "bad_base");
   static_assert(USES_P_O_BOX == size(kProblemNames) - 1, "bad_length");
diff --git a/cpp/src/address_ui.cc b/cpp/src/address_ui.cc
index 89cf586..7c8cea2 100644
--- a/cpp/src/address_ui.cc
+++ b/cpp/src/address_ui.cc
@@ -113,7 +113,7 @@
 
   bool preceded_by_newline = true;
   bool followed_by_newline = true;
-  for (std::vector<FormatElement>::const_iterator format_it = format.begin();
+  for (auto format_it = format.begin();
        format_it != format.end(); ++format_it) {
     if (format_it->IsNewline()) {
       preceded_by_newline = true;
@@ -123,7 +123,7 @@
       continue;
     }
     AddressUiComponent component;
-    std::vector<FormatElement>::const_iterator next_format_it = format_it + 1;
+    auto next_format_it = format_it + 1;
     followed_by_newline =
         next_format_it == format.end() || next_format_it->IsNewline();
     component.length_hint = preceded_by_newline && followed_by_newline
diff --git a/cpp/src/address_validator.cc b/cpp/src/address_validator.cc
index 367f2c2..9dfea1b 100644
--- a/cpp/src/address_validator.cc
+++ b/cpp/src/address_validator.cc
@@ -26,8 +26,7 @@
   assert(supplier_ != nullptr);
 }
 
-AddressValidator::~AddressValidator() {
-}
+AddressValidator::~AddressValidator() = default;
 
 void AddressValidator::Validate(const AddressData& address,
                                 bool allow_postal,
diff --git a/cpp/src/language.cc b/cpp/src/language.cc
index 28817dc..fa32ccb 100644
--- a/cpp/src/language.cc
+++ b/cpp/src/language.cc
@@ -53,7 +53,7 @@
       (subtags.size() > 2 && subtags[2] == kLowercaseLatinScript);
 }
 
-Language::~Language() {}
+Language::~Language() = default;
 
 Language ChooseBestAddressLanguage(const Rule& address_region_rule,
                                    const Language& ui_language) {
@@ -62,11 +62,8 @@
   }
 
   std::vector<Language> available_languages;
-  for (std::vector<std::string>::const_iterator
-       language_tag_it = address_region_rule.GetLanguages().begin();
-       language_tag_it != address_region_rule.GetLanguages().end();
-       ++language_tag_it) {
-    available_languages.push_back(Language(*language_tag_it));
+  for (const auto& language_tag : address_region_rule.GetLanguages()) {
+    available_languages.emplace_back(language_tag);
   }
 
   if (ui_language.tag.empty()) {
@@ -84,14 +81,12 @@
     return latin_script_language;
   }
 
-  for (std::vector<Language>::const_iterator
-       available_lang_it = available_languages.begin();
-       available_lang_it != available_languages.end(); ++available_lang_it) {
+  for (const auto& language : available_languages) {
     // Base language comparison works because no region supports the same base
     // language with different scripts, for now. For example, no region supports
     // "zh-Hant" and "zh-Hans" at the same time.
-    if (ui_language.base == available_lang_it->base) {
-      return *available_lang_it;
+    if (ui_language.base == language.base) {
+      return language;
     }
   }
 
diff --git a/cpp/src/localization.cc b/cpp/src/localization.cc
index c2a5a41..1a99617 100644
--- a/cpp/src/localization.cc
+++ b/cpp/src/localization.cc
@@ -56,7 +56,7 @@
 
 Localization::Localization() : get_string_(&GetEnglishString) {}
 
-Localization::~Localization() {}
+Localization::~Localization() = default;
 
 std::string Localization::GetString(int message_id) const {
   return get_string_(message_id);
@@ -99,7 +99,7 @@
     } else if (problem == UNKNOWN_VALUE) {
       std::vector<std::string> parameters;
       if (AddressData::IsRepeatedFieldValue(field)) {
-        std::vector<std::string> values = address.GetRepeatedFieldValue(field);
+        const auto& values = address.GetRepeatedFieldValue(field);
         assert(!values.empty());
         parameters.push_back(values.front());
       } else {
diff --git a/cpp/src/lookup_key.cc b/cpp/src/lookup_key.cc
index 7ff6f02..1c13796 100644
--- a/cpp/src/lookup_key.cc
+++ b/cpp/src/lookup_key.cc
@@ -21,10 +21,7 @@
 #include <cassert>
 #include <cstddef>
 #include <functional>
-#include <map>
 #include <string>
-#include <utility>
-#include <vector>
 
 #include "language.h"
 #include "region_data_constants.h"
@@ -56,7 +53,7 @@
           RegionDataConstants::GetRegionData(region_code))) {
     return false;
   }
-  const std::vector<std::string>& languages = rule.GetLanguages();
+  const auto& languages = rule.GetLanguages();
   // Do not add the default language (we want "data/US", not "data/US--en").
   // (empty should not happen here because we have some sub-region data).
   if (languages.empty() || languages[0] == language_tag) {
@@ -71,25 +68,21 @@
 }  // namespace
 
 const AddressField LookupKey::kHierarchy[] = {
-  COUNTRY,
-  ADMIN_AREA,
-  LOCALITY,
-  DEPENDENT_LOCALITY
+    COUNTRY,
+    ADMIN_AREA,
+    LOCALITY,
+    DEPENDENT_LOCALITY,
 };
 
-LookupKey::LookupKey() {
-}
-
-LookupKey::~LookupKey() {
-}
+LookupKey::LookupKey() = default;
+LookupKey::~LookupKey() = default;
 
 void LookupKey::FromAddress(const AddressData& address) {
   nodes_.clear();
   if (address.region_code.empty()) {
-    nodes_.insert(std::make_pair(COUNTRY, kUnknown));
+    nodes_.emplace(COUNTRY, kUnknown);
   } else {
-    for (size_t i = 0; i < size(kHierarchy); ++i) {
-      AddressField field = kHierarchy[i];
+    for (AddressField field : kHierarchy) {
       if (address.IsFieldEmpty(field)) {
         // It would be impossible to find any data for an empty field value.
         break;
@@ -101,7 +94,7 @@
         // lookup key format.
         break;
       }
-      nodes_.insert(std::make_pair(field, value));
+      nodes_.emplace(field, value);
     }
   }
   Language address_language(address.language_code);
@@ -121,7 +114,7 @@
   // Copy its nodes if this isn't the parent object.
   if (this != &parent) nodes_ = parent.nodes_;
   AddressField child_field = kHierarchy[nodes_.size()];
-  nodes_.insert(std::make_pair(child_field, child_node));
+  nodes_.emplace(child_field, child_node);
 }
 
 std::string LookupKey::ToKeyString(size_t max_depth) const {
@@ -130,7 +123,7 @@
 
   for (size_t i = 0; i <= max_depth; ++i) {
     AddressField field = kHierarchy[i];
-    std::map<AddressField, std::string>::const_iterator it = nodes_.find(field);
+    auto it = nodes_.find(field);
     if (it == nodes_.end()) {
       break;
     }
@@ -145,7 +138,7 @@
 }
 
 const std::string& LookupKey::GetRegionCode() const {
-  std::map<AddressField, std::string>::const_iterator it = nodes_.find(COUNTRY);
+  auto it = nodes_.find(COUNTRY);
   assert(it != nodes_.end());
   return it->second;
 }
diff --git a/cpp/src/null_storage.cc b/cpp/src/null_storage.cc
index 12c20c9..69387ea 100644
--- a/cpp/src/null_storage.cc
+++ b/cpp/src/null_storage.cc
@@ -21,11 +21,8 @@
 namespace i18n {
 namespace addressinput {
 
-NullStorage::NullStorage() {
-}
-
-NullStorage::~NullStorage() {
-}
+NullStorage::NullStorage() = default;
+NullStorage::~NullStorage() = default;
 
 void NullStorage::Put(const std::string& key, std::string* data) {
   assert(data != nullptr);  // Sanity check.
diff --git a/cpp/src/ondemand_supplier.cc b/cpp/src/ondemand_supplier.cc
index b6de593..82a4356 100644
--- a/cpp/src/ondemand_supplier.cc
+++ b/cpp/src/ondemand_supplier.cc
@@ -16,7 +16,6 @@
 
 #include <algorithm>
 #include <cstddef>
-#include <map>
 #include <string>
 
 #include "lookup_key.h"
@@ -33,9 +32,8 @@
 }
 
 OndemandSupplier::~OndemandSupplier() {
-  for (std::map<std::string, const Rule*>::const_iterator
-       it = rule_cache_.begin(); it != rule_cache_.end(); ++it) {
-    delete it->second;
+  for (const auto& pair : rule_cache_) {
+    delete pair.second;
   }
 }
 
@@ -46,8 +44,7 @@
 
 void OndemandSupplier::Supply(const LookupKey& lookup_key,
                               const Callback& supplied) {
-  OndemandSupplyTask* task =
-      new OndemandSupplyTask(lookup_key, &rule_cache_, supplied);
+  auto* task = new OndemandSupplyTask(lookup_key, &rule_cache_, supplied);
 
   if (RegionDataConstants::IsSupported(lookup_key.GetRegionCode())) {
     size_t max_depth = std::min(
@@ -56,8 +53,7 @@
 
     for (size_t depth = 0; depth <= max_depth; ++depth) {
       const std::string& key = lookup_key.ToKeyString(depth);
-      std::map<std::string, const Rule*>::const_iterator it =
-          rule_cache_.find(key);
+      auto it = rule_cache_.find(key);
       if (it != rule_cache_.end()) {
         task->hierarchy_.rule[depth] = it->second;
       } else {
diff --git a/cpp/src/ondemand_supply_task.cc b/cpp/src/ondemand_supply_task.cc
index 203a7c4..6b282e5 100644
--- a/cpp/src/ondemand_supply_task.cc
+++ b/cpp/src/ondemand_supply_task.cc
@@ -22,9 +22,7 @@
 #include <cassert>
 #include <cstddef>
 #include <map>
-#include <set>
 #include <string>
-#include <utility>
 
 #include "lookup_key.h"
 #include "retriever.h"
@@ -49,8 +47,7 @@
   assert(retrieved_ != nullptr);
 }
 
-OndemandSupplyTask::~OndemandSupplyTask() {
-}
+OndemandSupplyTask::~OndemandSupplyTask() = default;
 
 void OndemandSupplyTask::Queue(const std::string& key) {
   assert(pending_.find(key) == pending_.end());
@@ -70,7 +67,7 @@
     // otherwise obvious it != pending_.end() but instead test a local variable
     // that isn't affected by the object being deleted.
     bool done = false;
-    for (std::set<std::string>::const_iterator it = pending_.begin(); !done; ) {
+    for (auto it = pending_.begin(); !done;) {
       const std::string& key = *it++;
       done = it == pending_.end();
       retriever.Retrieve(key, *retrieved_);
@@ -93,7 +90,7 @@
     // The address metadata server will return the empty JSON "{}" when it
     // successfully performed a lookup, but didn't find any data for that key.
     if (data != "{}") {
-      Rule* rule = new Rule;
+      auto* rule = new Rule;
       if (LookupKey::kHierarchy[depth] == COUNTRY) {
         // All rules on the COUNTRY level inherit from the default rule.
         rule->CopyFrom(Rule::GetDefault());
@@ -109,8 +106,7 @@
         // certain alias is requested repeatedly, but such a cache would then
         // have to be kept to some limited size to not grow indefinitely with
         // every possible permutation of a name recognized by the data server.)
-        std::pair<std::map<std::string, const Rule*>::iterator, bool> result =
-            rule_cache_->insert(std::make_pair(rule->GetId(), rule));
+        auto result = rule_cache_->emplace(rule->GetId(), rule);
         if (!result.second) {  // There was already an entry with this ID.
           delete rule;
         }
diff --git a/cpp/src/post_box_matchers.cc b/cpp/src/post_box_matchers.cc
index fcb230a..6c9eea0 100644
--- a/cpp/src/post_box_matchers.cc
+++ b/cpp/src/post_box_matchers.cc
@@ -14,10 +14,11 @@
 
 #include "post_box_matchers.h"
 
+#include <algorithm>
+#include <cassert>
 #include <cstddef>
-#include <map>
+#include <cstring>
 #include <string>
-#include <utility>
 #include <vector>
 
 #include <re2/re2.h>
@@ -25,73 +26,156 @@
 #include "language.h"
 #include "rule.h"
 #include "util/re2ptr.h"
+#include "util/size.h"
 
 namespace i18n {
 namespace addressinput {
 
 namespace {
 
-std::map<std::string, const RE2ptr*> InitMatchers() {
-  static const struct {
-    const char* const language;
-    const RE2ptr ptr;
-  } kMatchers[] = {
-      {"ar", new RE2(u8R"(صندوق بريد|ص[-. ]ب)")},
-      {"cs", new RE2(u8R"((?i)p\.? ?p\.? \d)")},
-      {"da", new RE2(u8R"((?i)Postboks)")},
-      {"de", new RE2(u8R"((?i)Postfach)")},
-      {"el", new RE2(u8R"((?i)T\.? ?Θ\.? \d{2})")},
-      {"en", new RE2(u8R"(Private Bag|Post(?:al)? Box)")},
-      {"es", new RE2(u8R"((?i)(?:Apartado|Casillas) de correos?)")},
-      {"fi", new RE2(u8R"((?i)Postilokero|P\.?L\.? \d)")},
-      {"hr", new RE2(u8R"((?i)p\.? ?p\.? \d)")},
-      {"hu", new RE2(u8R"((?i)Postafi(?:[oó]|ó)k|Pf\.? \d)")},
-      {"fr", new RE2(u8R"((?i)Bo(?:[iî]|î)te Postale|BP \d|CEDEX \d)")},
-      {"ja", new RE2(u8R"(私書箱\d{1,5}号)")},
-      {"nl", new RE2(u8R"((?i)Postbus)")},
-      {"no", new RE2(u8R"((?i)Postboks)")},
-      {"pl", new RE2(u8R"((?i)Skr(?:\.?|ytka) poczt(?:\.?|owa))")},
-      {"pt", new RE2(u8R"((?i)Apartado)")},
-      {"ru", new RE2(u8R"((?i)абонентский ящик|[аa]"я (?:(?:№|#|N) ?)?\d)")},
-      {"sv", new RE2(u8R"((?i)Box \d)")},
-      {"zh", new RE2(u8R"(郵政信箱.{1,5}號|郵局第.{1,10}號信箱)")},
-      {"und", new RE2(u8R"(P\.? ?O\.? Box)")},
-  };
+// kLanguageInfoMap is a constant table that associates language names
+// with the corresponding matching regexp.
+//
+// NOTE: This array must be sorted in increasing language name values.
+//       this is checked at compile time through a static_assert() below.
+struct LanguageInfo {
+  const char* language;
+  const char* regexp;
 
-  std::map<std::string, const RE2ptr*> matchers;
+  static bool less(const LanguageInfo& a, const LanguageInfo& b) {
+      return strcmp(a.language, b.language) < 0;
+  }
+};
 
-  for (size_t i = 0; i < sizeof kMatchers / sizeof *kMatchers; ++i) {
-    matchers.insert(std::make_pair(kMatchers[i].language, &kMatchers[i].ptr));
+constexpr const LanguageInfo kLanguageInfoMap[] = {
+      {"ar", u8R"(صندوق بريد|ص[-. ]ب)"},
+      {"cs", u8R"((?i)p\.? ?p\.? \d)"},
+      {"da", u8R"((?i)Postboks)"},
+      {"de", u8R"((?i)Postfach)"},
+      {"el", u8R"((?i)T\.? ?Θ\.? \d{2})"},
+      {"en", u8R"(Private Bag|Post(?:al)? Box)"},
+      {"es", u8R"((?i)(?:Apartado|Casillas) de correos?)"},
+      {"fi", u8R"((?i)Postilokero|P\.?L\.? \d)"},
+      {"fr", u8R"((?i)Bo(?:[iî]|î)te Postale|BP \d|CEDEX \d)"},
+      {"hr", u8R"((?i)p\.? ?p\.? \d)"},
+      {"hu", u8R"((?i)Postafi(?:[oó]|ó)k|Pf\.? \d)"},
+      {"ja", u8R"(私書箱\d{1,5}号)"},
+      {"nl", u8R"((?i)Postbus)"},
+      {"no", u8R"((?i)Postboks)"},
+      {"pl", u8R"((?i)Skr(?:\.?|ytka) poczt(?:\.?|owa))"},
+      {"pt", u8R"((?i)Apartado)"},
+      {"ru", u8R"((?i)абонентский ящик|[аa]"я (?:(?:№|#|N) ?)?\d)"},
+      {"sv", u8R"((?i)Box \d)"},
+      {"und", u8R"(P\.? ?O\.? Box)"},
+      {"zh", u8R"(郵政信箱.{1,5}號|郵局第.{1,10}號信箱)"},
+};
+
+constexpr size_t kLanguageInfoMapSize = size(kLanguageInfoMap);
+// Compile-time function that returns true iff the content of string |a|
+// is less or equal to string |b|.
+constexpr bool StrLessOrEqualConstexpr(const char* a, const char* b) {
+  return (*a == '\0') ? true : (
+      (*a == *b) ? StrLessOrEqualConstexpr(a + 1, b + 1) : (*a < *b));
+}
+
+// Sanity checks.
+static_assert(StrLessOrEqualConstexpr("", ""), "");
+static_assert(StrLessOrEqualConstexpr("", "foo"), "");
+static_assert(!StrLessOrEqualConstexpr("foo", ""), "");
+static_assert(StrLessOrEqualConstexpr("foo", "foo"), "");
+static_assert(!StrLessOrEqualConstexpr("foo", "bar"), "");
+static_assert(StrLessOrEqualConstexpr("bar", "foo"), "");
+static_assert(StrLessOrEqualConstexpr("foo", "foobar"), "");
+static_assert(!StrLessOrEqualConstexpr("foobar", "foo"), "");
+
+// Compile-time function to verify that LanguageInfoMap is properly sorted.
+// The |n| parameter is a starting position for the check.
+constexpr bool CheckLanguageInfoMapOrderConstexpr(size_t n = 0) {
+  // Compare two items at positions |n| and |n + 1| and return false if they
+  // are not in the correct order, otherwise, recursively try remaining
+  // positions until the end of the array.
+  return !StrLessOrEqualConstexpr(kLanguageInfoMap[n].language,
+                                  kLanguageInfoMap[n + 1].language) ? false : (
+      (n + 2 < kLanguageInfoMapSize) ?
+         CheckLanguageInfoMapOrderConstexpr(n + 1) : true);
+}
+
+// Compile-time check for the order to kLanguageInfoMap entries.
+static_assert(CheckLanguageInfoMapOrderConstexpr(),
+              "kLanguageInfoMap is not correctly sorted!");
+
+// Return a pointer to the LanguageInfo entry corresponding to |language|
+// or nullptr if this wasn't found.
+const LanguageInfo* FindLanguageInfoFor(const std::string& language) {
+  const LanguageInfo* begin = kLanguageInfoMap;
+  const LanguageInfo* end = begin + kLanguageInfoMapSize;
+  LanguageInfo key = { language.c_str(), };
+  const LanguageInfo* probe =
+      std::lower_bound(begin, end, key, LanguageInfo::less);
+  if (probe != end && language == probe->language) {
+    return probe;
+  }
+  return nullptr;
+}
+
+// A convenience wrapper class for a fixed array of RE2PlainPtr that shall
+// only be instantiated as a static variable.
+class StaticRE2Array {
+ public:
+  StaticRE2Array() {
+    // Initialize all re2s_ instance now. Doing this lazily in findMatcherFor()
+    // would not be thread-safe, while doing it in the constructor of a static
+    // local variable is.
+    for (size_t n = 0; n < kLanguageInfoMapSize; ++n) {
+      re2s_[n].ptr = new RE2(kLanguageInfoMap[n].regexp);
+    }
   }
 
-  return matchers;
-}
+  ~StaticRE2Array() {
+    // Destroy all instances on destruction. Since this is a static variable
+    // this will only happen on program exit, or if the library is unloaded
+    // at runtime (e.g. through dlclose()).
+    for (auto& entry : re2s_) {
+      delete entry.ptr;
+    }
+  }
+
+  // Return a pointer to the RE2 instance matching |language|, or nullptr
+  // if there is none.
+  const RE2PlainPtr* FindMatcherFor(const std::string& language) const {
+    const LanguageInfo* info = FindLanguageInfoFor(language);
+    if (!info) {
+      return nullptr;
+    }
+    size_t idx = info - kLanguageInfoMap;
+    assert(idx < kLanguageInfoMapSize);
+    return &re2s_[idx];
+  }
+
+ private:
+  RE2PlainPtr re2s_[kLanguageInfoMapSize];
+};
 
 }  // namespace
 
 // static
-std::vector<const RE2ptr*> PostBoxMatchers::GetMatchers(
+std::vector<const RE2PlainPtr*> PostBoxMatchers::GetMatchers(
     const Rule& country_rule) {
-  static const std::map<std::string, const RE2ptr*> kMatchers(InitMatchers());
+  static const StaticRE2Array kMatchers;
 
   // Always add any expressions defined for "und" (English-like defaults).
-  std::vector<std::string> languages(1, "und");
-  for (std::vector<std::string>::const_iterator
-       it = country_rule.GetLanguages().begin();
-       it != country_rule.GetLanguages().end(); ++it) {
-    Language language(*it);
+  std::vector<std::string> languages{"und"};
+  for (const auto& language_tag : country_rule.GetLanguages()) {
+    Language language(language_tag);
     languages.push_back(language.base);
   }
 
-  std::vector<const RE2ptr*> result;
+  std::vector<const RE2PlainPtr*> result;
 
-  for (std::vector<std::string>::const_iterator
-       it = languages.begin();
-       it != languages.end(); ++it) {
-    std::map<std::string, const RE2ptr*>::const_iterator
-        jt = kMatchers.find(*it);
-    if (jt != kMatchers.end()) {
-      result.push_back(jt->second);
+  for (const auto& language_tag : languages) {
+    const RE2PlainPtr* matcher = kMatchers.FindMatcherFor(language_tag);
+    if (matcher != nullptr) {
+      result.push_back(matcher);
     }
   }
 
diff --git a/cpp/src/post_box_matchers.h b/cpp/src/post_box_matchers.h
index 61b7d9c..925edc6 100644
--- a/cpp/src/post_box_matchers.h
+++ b/cpp/src/post_box_matchers.h
@@ -23,13 +23,13 @@
 namespace addressinput {
 
 class Rule;
-struct RE2ptr;
+struct RE2PlainPtr;
 
 class PostBoxMatchers {
  public:
   // Returns pointers to RE2 regular expression objects to test address lines
   // for those languages that are relevant for |country_rule|.
-  static std::vector<const RE2ptr*> GetMatchers(const Rule& country_rule);
+  static std::vector<const RE2PlainPtr*> GetMatchers(const Rule& country_rule);
 
   PostBoxMatchers(const PostBoxMatchers&) = delete;
   PostBoxMatchers& operator=(const PostBoxMatchers&) = delete;
diff --git a/cpp/src/preload_supplier.cc b/cpp/src/preload_supplier.cc
index e9cad83..75aff87 100644
--- a/cpp/src/preload_supplier.cc
+++ b/cpp/src/preload_supplier.cc
@@ -28,7 +28,6 @@
 #include <set>
 #include <stack>
 #include <string>
-#include <utility>
 #include <vector>
 
 #include "lookup_key.h"
@@ -96,7 +95,7 @@
   }
 
  private:
-  ~Helper() {}
+  ~Helper() = default;
 
   void OnRetrieved(bool success,
                    const std::string& key,
@@ -111,11 +110,10 @@
     std::string id;
     std::vector<const Rule*> sub_rules;
 
-    IndexMap::iterator last_index_it = rule_index_->end();
-    IndexMap::iterator last_latin_it = rule_index_->end();
-    IndexMap::iterator language_index_it = language_rule_index_->end();
-    std::map<std::string, const Rule*>::iterator last_region_it =
-        region_rules_->end();
+    auto last_index_it = rule_index_->end();
+    auto last_latin_it = rule_index_->end();
+    auto language_index_it = language_rule_index_->end();
+    auto last_region_it = region_rules_->end();
 
     IndexMap::const_iterator hints[size(LookupKey::kHierarchy) - 1];
     std::fill(hints, hints + size(hints), rule_index_->end());
@@ -129,13 +127,9 @@
       goto callback;
     }
 
-    for (std::vector<const Json*>::const_iterator
-         it = json.GetSubDictionaries().begin();
-         it != json.GetSubDictionaries().end();
-         ++it) {
-      const Json* value = *it;
-      assert(value != nullptr);
-      if (!value->GetStringValueForKey("id", &id)) {
+    for (auto ptr : json.GetSubDictionaries()) {
+      assert(ptr != nullptr);
+      if (!ptr->GetStringValueForKey("id", &id)) {
         success = false;
         goto callback;
       }
@@ -145,12 +139,12 @@
       assert(depth < size(LookupKey::kHierarchy));
       AddressField field = LookupKey::kHierarchy[depth];
 
-      Rule* rule = new Rule;
+      auto* rule = new Rule;
       if (field == COUNTRY) {
         // All rules on the COUNTRY level inherit from the default rule.
         rule->CopyFrom(Rule::GetDefault());
       }
-      rule->ParseJsonRule(*value);
+      rule->ParseJsonRule(*ptr);
       assert(id == rule->GetId());  // Sanity check.
 
       rule_storage_->push_back(rule);
@@ -160,13 +154,11 @@
 
       // Add the ID of this Rule object to the rule index with natural string
       // comparison for keys.
-      last_index_it =
-          rule_index_->insert(last_index_it, std::make_pair(id, rule));
+      last_index_it = rule_index_->emplace_hint(last_index_it, id, rule);
 
       // Add the ID of this Rule object to the region-specific rule index with
       // exact string comparison for keys.
-      last_region_it =
-          region_rules_->insert(last_region_it, std::make_pair(id, rule));
+      last_region_it = region_rules_->emplace_hint(last_region_it, id, rule);
 
       ++rule_count;
     }
@@ -184,13 +176,13 @@
     // each of them construct ID strings using human readable names (eg. "São
     // Paulo") and using Latin script names (eg. "Tokushima").
     //
-    for (std::vector<const Rule*>::const_iterator
-         it = sub_rules.begin(); it != sub_rules.end(); ++it) {
+    for (auto ptr : sub_rules) {
+      assert(ptr != nullptr);
       std::stack<const Rule*> hierarchy;
-      hierarchy.push(*it);
+      hierarchy.push(ptr);
 
       // Push pointers to all parent Rule objects onto the hierarchy stack.
-      for (std::string parent_id((*it)->GetId());;) {
+      for (std::string parent_id(ptr->GetId());;) {
         // Strip the last part of parent_id. Break if COUNTRY level is reached.
         std::string::size_type pos = parent_id.rfind('/');
         if (pos == sizeof "data/ZZ" - 1) {
@@ -206,7 +198,7 @@
         hierarchy.push((*hint)->second);
       }
 
-      std::string human_id((*it)->GetId().substr(0, sizeof "data/ZZ" - 1));
+      std::string human_id(ptr->GetId().substr(0, sizeof "data/ZZ" - 1));
       std::string latin_id(human_id);
 
       // Append the names from all Rule objects on the hierarchy stack.
@@ -232,24 +224,22 @@
 
       // If the ID has a language tag, copy it.
       {
-        const std::string& id = (*it)->GetId();
+        const std::string& id = ptr->GetId();
         std::string::size_type pos = id.rfind("--");
         if (pos != std::string::npos) {
-          language_index_it = language_rule_index_->insert(
-              language_index_it, std::make_pair(human_id, *it));
+          language_index_it = language_rule_index_->emplace_hint(
+              language_index_it, human_id, ptr);
           human_id.append(id, pos, id.size() - pos);
         }
       }
 
-      last_index_it =
-          rule_index_->insert(last_index_it, std::make_pair(human_id, *it));
+      last_index_it = rule_index_->emplace_hint(last_index_it, human_id, ptr);
 
       // Add the Latin script ID, if a Latin script name could be found for
       // every part of the ID.
       if (std::count(human_id.begin(), human_id.end(), '/') ==
           std::count(latin_id.begin(), latin_id.end(), '/')) {
-        last_latin_it =
-            rule_index_->insert(last_latin_it, std::make_pair(latin_id, *it));
+        last_latin_it = rule_index_->emplace_hint(last_latin_it, latin_id, ptr);
       }
     }
 
@@ -287,9 +277,8 @@
       region_rules_() {}
 
 PreloadSupplier::~PreloadSupplier() {
-  for (std::vector<const Rule*>::const_iterator
-       it = rule_storage_.begin(); it != rule_storage_.end(); ++it) {
-    delete *it;
+  for (auto ptr : rule_storage_) {
+    delete ptr;
   }
 }
 
diff --git a/cpp/src/region_data.cc b/cpp/src/region_data.cc
index 49b8e75..04a0398 100644
--- a/cpp/src/region_data.cc
+++ b/cpp/src/region_data.cc
@@ -28,15 +28,14 @@
       sub_regions_() {}
 
 RegionData::~RegionData() {
-  for (std::vector<const RegionData*>::const_iterator it = sub_regions_.begin();
-       it != sub_regions_.end(); ++it) {
-    delete *it;
+  for (auto ptr : sub_regions_) {
+    delete ptr;
   }
 }
 
 RegionData* RegionData::AddSubRegion(const std::string& key,
                                      const std::string& name) {
-  RegionData* sub_region = new RegionData(key, name, this);
+  auto* sub_region = new RegionData(key, name, this);
   sub_regions_.push_back(sub_region);
   return sub_region;
 }
diff --git a/cpp/src/region_data_builder.cc b/cpp/src/region_data_builder.cc
index 4305635..d2c1635 100644
--- a/cpp/src/region_data_builder.cc
+++ b/cpp/src/region_data_builder.cc
@@ -21,7 +21,6 @@
 #include <cassert>
 #include <cstddef>
 #include <string>
-#include <utility>
 #include <vector>
 
 #include "language.h"
@@ -36,7 +35,7 @@
 namespace {
 
 // The maximum depth of lookup keys.
-static const size_t kLookupKeysMaxDepth = size(LookupKey::kHierarchy) - 1;
+const size_t kLookupKeysMaxDepth = size(LookupKey::kHierarchy) - 1;
 
 // Does not take ownership of |parent_region|, which is not allowed to be
 // nullptr.
@@ -51,9 +50,8 @@
   assert(parent_region != nullptr);
 
   LookupKey lookup_key;
-  for (std::vector<std::string>::const_iterator key_it = keys.begin();
-       key_it != keys.end(); ++key_it) {
-    lookup_key.FromLookupKey(parent_key, *key_it);
+  for (const auto& key : keys) {
+    lookup_key.FromLookupKey(parent_key, key);
     const std::string& lookup_key_string =
         lookup_key.ToKeyString(kLookupKeysMaxDepth);
 
@@ -69,11 +67,11 @@
     assert(rule != nullptr);
 
     const std::string& local_name = rule->GetName().empty()
-        ? *key_it : rule->GetName();
+        ? key : rule->GetName();
     const std::string& name =
         prefer_latin_name && !rule->GetLatinName().empty()
             ? rule->GetLatinName() : local_name;
-    RegionData* region = parent_region->AddSubRegion(*key_it, name);
+    RegionData* region = parent_region->AddSubRegion(key, name);
 
     if (!rule->GetSubKeys().empty() &&
         region_max_depth > parent_key.GetDepth()) {
@@ -98,14 +96,13 @@
   LookupKey lookup_key;
   lookup_key.FromAddress(address);
 
-  std::map<std::string, const Rule*>::const_iterator hint =
-      rules.find(lookup_key.ToKeyString(kLookupKeysMaxDepth));
+  auto hint = rules.find(lookup_key.ToKeyString(kLookupKeysMaxDepth));
   assert(hint != rules.end());
 
   const Rule* rule = hint->second;
   assert(rule != nullptr);
 
-  RegionData* region = new RegionData(region_code);
+  auto* region = new RegionData(region_code);
 
   // If there are sub-keys for field X, but field X is not used in this region
   // code, then these sub-keys are skipped over. For example, CH has sub-keys
@@ -134,14 +131,12 @@
 }
 
 RegionDataBuilder::~RegionDataBuilder() {
-  for (RegionCodeDataMap::const_iterator region_it = cache_.begin();
-       region_it != cache_.end(); ++region_it) {
-    for (LanguageRegionMap::const_iterator
-         language_it = region_it->second->begin();
-         language_it != region_it->second->end(); ++language_it) {
-      delete language_it->second;
+  for (const auto& outer : cache_) {
+    assert(outer.second != nullptr);
+    for (const auto& inner : *outer.second) {
+      delete inner.second;
     }
-    delete region_it->second;
+    delete outer.second;
   }
 }
 
@@ -155,8 +150,7 @@
   // Look up the region tree in cache first before building it.
   RegionCodeDataMap::const_iterator region_it = cache_.find(region_code);
   if (region_it == cache_.end()) {
-    region_it =
-        cache_.insert(std::make_pair(region_code, new LanguageRegionMap)).first;
+    region_it = cache_.emplace(region_code, new LanguageRegionMap).first;
   }
 
   // No need to copy from default rule first, because only languages and Latin
@@ -173,14 +167,11 @@
   LanguageRegionMap::const_iterator language_it =
       region_it->second->find(best_language.tag);
   if (language_it == region_it->second->end()) {
-    const std::map<std::string, const Rule*>& rules =
-        supplier_->GetRulesForRegion(region_code);
-    language_it =
-        region_it->second->insert(std::make_pair(best_language.tag,
-                                                 BuildRegion(rules,
-                                                             region_code,
-                                                             best_language)))
-            .first;
+    const auto& rules = supplier_->GetRulesForRegion(region_code);
+    language_it = region_it->second
+                      ->emplace(best_language.tag,
+                                BuildRegion(rules, region_code, best_language))
+                      .first;
   }
 
   return *language_it->second;
diff --git a/cpp/src/region_data_constants.cc b/cpp/src/region_data_constants.cc
index 8c9f38f..d702adb 100644
--- a/cpp/src/region_data_constants.cc
+++ b/cpp/src/region_data_constants.cc
@@ -23,7 +23,6 @@
 #include <map>
 #include <set>
 #include <string>
-#include <utility>
 #include <vector>
 
 #include "address_field_util.h"
@@ -37,61 +36,61 @@
 
 std::map<std::string, std::string> InitRegionData() {
   std::map<std::string, std::string> region_data;
-  region_data.insert(std::make_pair("AC", "{"
+  region_data.emplace("AC", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"ASCN 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("AD", "{"
+      "}");
+  region_data.emplace("AD", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"AD100,AD501,AD700",)"
       u8R"("posturl":"http://www.correos.es/comun/CodigosPostales/1010_s-CodPostal.asp?Provincia=",)"
       u8R"("languages":"ca")"
-      "}"));
-  region_data.insert(std::make_pair("AE", "{"
+      "}");
+  region_data.emplace("AE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%S",)"
       u8R"("lfmt":"%N%n%O%n%A%n%S",)"
       u8R"("require":"AS",)"
       u8R"("state_name_type":"emirate",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("AF", "{"
+      "}");
+  region_data.emplace("AF", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"1001,2601,3801",)"
       u8R"("languages":"fa~ps~uz-Arab~tk~bal")"
-      "}"));
-  region_data.insert(std::make_pair("AG", "{"
+      "}");
+  region_data.emplace("AG", "{"
       u8R"("require":"A",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("AI", "{"
+      "}");
+  region_data.emplace("AI", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"2640",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("AL", "{"
+      "}");
+  region_data.emplace("AL", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z%n%C",)"
       u8R"("zipex":"1001,1017,3501",)"
       u8R"("languages":"sq")"
-      "}"));
-  region_data.insert(std::make_pair("AM", "{"
+      "}");
+  region_data.emplace("AM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z%n%C%n%S",)"
       u8R"("lfmt":"%N%n%O%n%A%n%Z%n%C%n%S",)"
       u8R"("zipex":"375010,0002,0010",)"
       u8R"("languages":"hy")"
-      "}"));
-  region_data.insert(std::make_pair("AO", "{"
+      "}");
+  region_data.emplace("AO", "{"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("AQ", "{"
-      "}"));
-  region_data.insert(std::make_pair("AR", "{"
+      "}");
+  region_data.emplace("AQ", "{"
+      "}");
+  region_data.emplace("AR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C%n%S",)"
       u8R"("zipex":"C1070AAM,C1000WAM,B1000TBU,X5187XAB",)"
       u8R"("posturl":"http://www.correoargentino.com.ar/formularios/cpa",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("AS", "{"
+      "}");
+  region_data.emplace("AS", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -99,15 +98,15 @@
       u8R"("zipex":"96799",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"sm~en")"
-      "}"));
-  region_data.insert(std::make_pair("AT", "{"
+      "}");
+  region_data.emplace("AT", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"1010,3741",)"
       u8R"("posturl":"http://www.post.at/post_subsite_postleitzahlfinder.php",)"
       u8R"("languages":"de~hr~sl~hu")"
-      "}"));
-  region_data.insert(std::make_pair("AU", "{"
+      "}");
+  region_data.emplace("AU", "{"
       u8R"("fmt":"%O%n%N%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("state_name_type":"state",)"
@@ -115,93 +114,93 @@
       u8R"("zipex":"2060,3171,6430,4000,4006,3001",)"
       u8R"("posturl":"http://www1.auspost.com.au/postcodes/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("AW", "{"
+      "}");
+  region_data.emplace("AW", "{"
       u8R"("languages":"nl~pap")"
-      "}"));
-  region_data.insert(std::make_pair("AX", "{"
+      "}");
+  region_data.emplace("AX", "{"
       u8R"("fmt":"%O%n%N%n%A%nAX-%Z %C%nÅLAND",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"22150,22550,22240,22710,22270,22730,22430",)"
       u8R"("posturl":"http://www.posten.ax/department.con?iPage=123",)"
       u8R"("languages":"sv")"
-      "}"));
-  region_data.insert(std::make_pair("AZ", "{"
+      "}");
+  region_data.emplace("AZ", "{"
       u8R"("fmt":"%N%n%O%n%A%nAZ %Z %C",)"
       u8R"("zipex":"1000",)"
       u8R"("languages":"az~az-Cyrl")"
-      "}"));
-  region_data.insert(std::make_pair("BA", "{"
+      "}");
+  region_data.emplace("BA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"71000",)"
       u8R"("languages":"bs~bs-Cyrl~hr~sr~sr-Latn")"
-      "}"));
-  region_data.insert(std::make_pair("BB", "{"
+      "}");
+  region_data.emplace("BB", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S %Z",)"
       u8R"("state_name_type":"parish",)"
       u8R"("zipex":"BB23026,BB22025",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("BD", "{"
+      "}");
+  region_data.emplace("BD", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C - %Z",)"
       u8R"("zipex":"1340,1000",)"
       u8R"("posturl":"http://www.bangladeshpost.gov.bd/PostCode.asp",)"
       u8R"("languages":"bn")"
-      "}"));
-  region_data.insert(std::make_pair("BE", "{"
+      "}");
+  region_data.emplace("BE", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"4000,1000",)"
       u8R"("posturl":"http://www.post.be/site/nl/residential/customerservice/search/postal_codes.html",)"
       u8R"("languages":"nl~fr~de")"
-      "}"));
-  region_data.insert(std::make_pair("BF", "{"
+      "}");
+  region_data.emplace("BF", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %X",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("BG", "{"
+      "}");
+  region_data.emplace("BG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1000,1700",)"
       u8R"("posturl":"http://www.bgpost.bg/?cid=5",)"
       u8R"("languages":"bg")"
-      "}"));
-  region_data.insert(std::make_pair("BH", "{"
+      "}");
+  region_data.emplace("BH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"317",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("BI", "{"
+      "}");
+  region_data.emplace("BI", "{"
       u8R"("languages":"rn~fr~en")"
-      "}"));
-  region_data.insert(std::make_pair("BJ", "{"
+      "}");
+  region_data.emplace("BJ", "{"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("BL", "{"
+      "}");
+  region_data.emplace("BL", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97100",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("BM", "{"
+      "}");
+  region_data.emplace("BM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"FL 07,HM GX,HM 12",)"
       u8R"("posturl":"http://www.landvaluation.bm/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("BN", "{"
+      "}");
+  region_data.emplace("BN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"BT2328,KA1131,BA1511",)"
       u8R"("posturl":"http://www.post.gov.bn/SitePages/postcodes.aspx",)"
       u8R"("languages":"ms~ms-Arab")"
-      "}"));
-  region_data.insert(std::make_pair("BO", "{"
+      "}");
+  region_data.emplace("BO", "{"
       u8R"("languages":"es~qu~ay")"
-      "}"));
-  region_data.insert(std::make_pair("BQ", "{"
+      "}");
+  region_data.emplace("BQ", "{"
       u8R"("languages":"nl")"
-      "}"));
-  region_data.insert(std::make_pair("BR", "{"
+      "}");
+  region_data.emplace("BR", "{"
       u8R"("fmt":"%O%n%N%n%A%n%D%n%C-%S%n%Z",)"
       u8R"("require":"ASCZ",)"
       u8R"("state_name_type":"state",)"
@@ -209,77 +208,77 @@
       u8R"("zipex":"40301-110,70002-900",)"
       u8R"("posturl":"http://www.buscacep.correios.com.br/",)"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("BS", "{"
+      "}");
+  region_data.emplace("BS", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S",)"
       u8R"("state_name_type":"island",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("BT", "{"
+      "}");
+  region_data.emplace("BT", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"11001,31101,35003",)"
       u8R"("posturl":"http://www.bhutanpost.bt/searchpostcode.php",)"
       u8R"("languages":"dz")"
-      "}"));
-  region_data.insert(std::make_pair("BV", "{"
-      "}"));
-  region_data.insert(std::make_pair("BW", "{"
+      "}");
+  region_data.emplace("BV", "{"
+      "}");
+  region_data.emplace("BW", "{"
       u8R"("languages":"en~tn")"
-      "}"));
-  region_data.insert(std::make_pair("BY", "{"
+      "}");
+  region_data.emplace("BY", "{"
       u8R"("fmt":"%S%n%Z %C%n%A%n%O%n%N",)"
       u8R"("zipex":"223016,225860,220050",)"
       u8R"("posturl":"http://ex.belpost.by/addressbook/",)"
       u8R"("languages":"be~ru")"
-      "}"));
-  region_data.insert(std::make_pair("BZ", "{"
+      "}");
+  region_data.emplace("BZ", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("CA", "{"
+      "}");
+  region_data.emplace("CA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zipex":"H3Z 2Y7,V8X 3X4,T0L 1K0,T0H 1A0,K1A 0B1",)"
       u8R"("posturl":"https://www.canadapost.ca/cpo/mc/personal/postalcode/fpc.jsf",)"
       u8R"("languages":"en~fr")"
-      "}"));
-  region_data.insert(std::make_pair("CC", "{"
+      "}");
+  region_data.emplace("CC", "{"
       u8R"("fmt":"%O%n%N%n%A%n%C %S %Z",)"
       u8R"("zipex":"6799",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("CD", "{"
+      "}");
+  region_data.emplace("CD", "{"
       u8R"("languages":"sw~lua~fr~ln~kg")"
-      "}"));
-  region_data.insert(std::make_pair("CF", "{"
+      "}");
+  region_data.emplace("CF", "{"
       u8R"("languages":"fr~sg")"
-      "}"));
-  region_data.insert(std::make_pair("CG", "{"
+      "}");
+  region_data.emplace("CG", "{"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("CH", "{"
+      "}");
+  region_data.emplace("CH", "{"
       u8R"("fmt":"%O%n%N%n%A%nCH-%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"2544,1211,1556,3030",)"
       u8R"("posturl":"http://www.post.ch/db/owa/pv_plz_pack/pr_main",)"
       u8R"("languages":"de~gsw~fr~it~rm")"
-      "}"));
-  region_data.insert(std::make_pair("CI", "{"
+      "}");
+  region_data.emplace("CI", "{"
       u8R"("fmt":"%N%n%O%n%X %A %C %X",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("CK", "{"
+      "}");
+  region_data.emplace("CK", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("CL", "{"
+      "}");
+  region_data.emplace("CL", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C%n%S",)"
       u8R"("zipex":"8340457,8720019,1230000,8329100",)"
       u8R"("posturl":"http://www.correos.cl/SitePages/home.aspx",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("CM", "{"
+      "}");
+  region_data.emplace("CM", "{"
       u8R"("languages":"fr~en")"
-      "}"));
-  region_data.insert(std::make_pair("CN", "{"
+      "}");
+  region_data.emplace("CN", "{"
       u8R"("fmt":"%Z%n%S%C%D%n%A%n%O%n%N",)"
       u8R"("lfmt":"%N%n%O%n%A%n%D%n%C%n%S, %Z",)"
       u8R"("require":"ACSZ",)"
@@ -287,133 +286,139 @@
       u8R"("zipex":"266033,317204,100096,100808",)"
       u8R"("posturl":"http://www.ems.com.cn/serviceguide/you_bian_cha_xun.html",)"
       u8R"("languages":"zh")"
-      "}"));
-  region_data.insert(std::make_pair("CO", "{"
+      "}");
+  region_data.emplace("CO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S, %Z",)"
       u8R"("require":"AS",)"
       u8R"("state_name_type":"department",)"
       u8R"("zipex":"111221,130001,760011",)"
       u8R"("posturl":"http://www.codigopostal.gov.co/",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("CR", "{"
+      "}");
+  region_data.emplace("CR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%S, %C%n%Z",)"
       u8R"("require":"ACS",)"
       u8R"("zipex":"1000,2010,1001",)"
       u8R"("posturl":"https://www.correos.go.cr/nosotros/codigopostal/busqueda.html",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("CV", "{"
+      "}");
+  region_data.emplace("CU", "{"
+      u8R"("fmt":"%N%n%O%n%A%n%S%C%n%Z",)"
+      u8R"("zipex":"10700",)"
+      u8R"("languages":"es")"
+      "}");
+  region_data.emplace("CV", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C%n%S",)"
       u8R"("state_name_type":"island",)"
       u8R"("zipex":"7600",)"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("CW", "{"
+      "}");
+  region_data.emplace("CW", "{"
       u8R"("languages":"pap~nl")"
-      "}"));
-  region_data.insert(std::make_pair("CX", "{"
+      "}");
+  region_data.emplace("CX", "{"
       u8R"("fmt":"%O%n%N%n%A%n%C %S %Z",)"
       u8R"("zipex":"6798",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("CY", "{"
+      "}");
+  region_data.emplace("CY", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"2008,3304,1900",)"
       u8R"("languages":"el~tr")"
-      "}"));
-  region_data.insert(std::make_pair("CZ", "{"
+      "}");
+  region_data.emplace("CZ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
+      u8R"("require":"ACZ",)"
       u8R"("zipex":"100 00,251 66,530 87,110 00,225 99",)"
       u8R"("posturl":"http://psc.ceskaposta.cz/CleanForm.action",)"
       u8R"("languages":"cs")"
-      "}"));
-  region_data.insert(std::make_pair("DE", "{"
+      "}");
+  region_data.emplace("DE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"26133,53225",)"
       u8R"("posturl":"http://www.postdirekt.de/plzserver/",)"
       u8R"("languages":"de")"
-      "}"));
-  region_data.insert(std::make_pair("DJ", "{"
+      "}");
+  region_data.emplace("DJ", "{"
       u8R"("languages":"ar~fr")"
-      "}"));
-  region_data.insert(std::make_pair("DK", "{"
+      "}");
+  region_data.emplace("DK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"8660,1566",)"
       u8R"("posturl":"http://www.postdanmark.dk/da/Privat/Kundeservice/postnummerkort/Sider/Find-postnummer.aspx",)"
       u8R"("languages":"da~de~kl")"
-      "}"));
-  region_data.insert(std::make_pair("DM", "{"
+      "}");
+  region_data.emplace("DM", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("DO", "{"
+      "}");
+  region_data.emplace("DO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"11903,10101",)"
       u8R"("posturl":"http://inposdom.gob.do/codigo-postal/",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("DZ", "{"
+      "}");
+  region_data.emplace("DZ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"40304,16027",)"
       u8R"("languages":"ar~fr")"
-      "}"));
-  region_data.insert(std::make_pair("EC", "{"
+      "}");
+  region_data.emplace("EC", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z%n%C",)"
       u8R"("zipex":"090105,092301",)"
       u8R"("posturl":"http://www.codigopostal.gob.ec/",)"
       u8R"("languages":"es~qu")"
-      "}"));
-  region_data.insert(std::make_pair("EE", "{"
+      "}");
+  region_data.emplace("EE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"69501,11212",)"
       u8R"("posturl":"https://www.omniva.ee/era/sihtnumbrite_otsing",)"
       u8R"("languages":"et")"
-      "}"));
-  region_data.insert(std::make_pair("EG", "{"
+      "}");
+  region_data.emplace("EG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S%n%Z",)"
       u8R"("lfmt":"%N%n%O%n%A%n%C%n%S%n%Z",)"
       u8R"("zipex":"12411,11599",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("EH", "{"
+      "}");
+  region_data.emplace("EH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"70000,72000",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("ER", "{"
+      "}");
+  region_data.emplace("ER", "{"
       u8R"("languages":"ti~en~ar")"
-      "}"));
-  region_data.insert(std::make_pair("ES", "{"
+      "}");
+  region_data.emplace("ES", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C %S",)"
       u8R"("require":"ACSZ",)"
       u8R"("zipex":"28039,28300,28070",)"
       u8R"("posturl":"http://www.correos.es/contenido/13-MenuRec2/04-MenuRec24/1010_s-CodPostal.asp",)"
       u8R"("languages":"es~ca~gl~eu")"
-      "}"));
-  region_data.insert(std::make_pair("ET", "{"
+      "}");
+  region_data.emplace("ET", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1000",)"
       u8R"("languages":"am")"
-      "}"));
-  region_data.insert(std::make_pair("FI", "{"
+      "}");
+  region_data.emplace("FI", "{"
       u8R"("fmt":"%O%n%N%n%A%nFI-%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"00550,00011",)"
       u8R"("posturl":"http://www.verkkoposti.com/e3/postinumeroluettelo",)"
       u8R"("languages":"fi~sv")"
-      "}"));
-  region_data.insert(std::make_pair("FJ", "{"
+      "}");
+  region_data.emplace("FJ", "{"
       u8R"("languages":"en~hif~fj")"
-      "}"));
-  region_data.insert(std::make_pair("FK", "{"
+      "}");
+  region_data.emplace("FK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"FIQQ 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("FM", "{"
+      "}");
+  region_data.emplace("FM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -421,163 +426,163 @@
       u8R"("zipex":"96941,96944",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("FO", "{"
+      "}");
+  region_data.emplace("FO", "{"
       u8R"("fmt":"%N%n%O%n%A%nFO%Z %C",)"
       u8R"("zipex":"100",)"
       u8R"("posturl":"http://www.postur.fo/",)"
       u8R"("languages":"fo")"
-      "}"));
-  region_data.insert(std::make_pair("FR", "{"
+      "}");
+  region_data.emplace("FR", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"33380,34092,33506",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("GA", "{"
+      "}");
+  region_data.emplace("GA", "{"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("GB", "{"
+      "}");
+  region_data.emplace("GB", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("locality_name_type":"post_town",)"
       u8R"("zipex":"EC1Y 8SY,GIR 0AA,M2 5BQ,M34 4AB,CR0 2YR,DN16 9AA,W1A 4ZZ,EC1A 1HQ,OX14 4PG,BS18 8HF,NR25 7HG,RH6 0NP,BH23 6AA,B6 5BA,SO23 9AP,PO1 3AX,BFPO 61",)"
       u8R"("posturl":"http://www.royalmail.com/postcode-finder",)"
       u8R"("languages":"en~cy~gd~ga")"
-      "}"));
-  region_data.insert(std::make_pair("GD", "{"
+      "}");
+  region_data.emplace("GD", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("GE", "{"
+      "}");
+  region_data.emplace("GE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"0101",)"
       u8R"("posturl":"http://www.georgianpost.ge/index.php?page=10",)"
       u8R"("languages":"ka~ab~os")"
-      "}"));
-  region_data.insert(std::make_pair("GF", "{"
+      "}");
+  region_data.emplace("GF", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97300",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("GG", "{"
+      "}");
+  region_data.emplace("GG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%nGUERNSEY%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"GY1 1AA,GY2 2BT",)"
       u8R"("posturl":"http://www.guernseypost.com/postcode_finder/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("GH", "{"
+      "}");
+  region_data.emplace("GH", "{"
       u8R"("languages":"ak~en~ee~gaa")"
-      "}"));
-  region_data.insert(std::make_pair("GI", "{"
+      "}");
+  region_data.emplace("GI", "{"
       u8R"("fmt":"%N%n%O%n%A%nGIBRALTAR%n%Z",)"
       u8R"("require":"A",)"
       u8R"("zipex":"GX11 1AA",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("GL", "{"
+      "}");
+  region_data.emplace("GL", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"3900,3950,3911",)"
       u8R"("languages":"kl")"
-      "}"));
-  region_data.insert(std::make_pair("GM", "{"
+      "}");
+  region_data.emplace("GM", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("GN", "{"
+      "}");
+  region_data.emplace("GN", "{"
       u8R"("fmt":"%N%n%O%n%Z %A %C",)"
       u8R"("zipex":"001,200,100",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("GP", "{"
+      "}");
+  region_data.emplace("GP", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97100",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("GQ", "{"
+      "}");
+  region_data.emplace("GQ", "{"
       u8R"("languages":"es~fr~pt")"
-      "}"));
-  region_data.insert(std::make_pair("GR", "{"
+      "}");
+  region_data.emplace("GR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"151 24,151 10,101 88",)"
       u8R"("posturl":"http://www.elta.gr/findapostcode.aspx",)"
       u8R"("languages":"el")"
-      "}"));
-  region_data.insert(std::make_pair("GS", "{"
+      "}");
+  region_data.emplace("GS", "{"
       u8R"("fmt":"%N%n%O%n%A%n%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"SIQQ 1ZZ")"
-      "}"));
-  region_data.insert(std::make_pair("GT", "{"
+      "}");
+  region_data.emplace("GT", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z- %C",)"
       u8R"("zipex":"09001,01501",)"
       u8R"("languages":"es~quc")"
-      "}"));
-  region_data.insert(std::make_pair("GU", "{"
+      "}");
+  region_data.emplace("GU", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zip_name_type":"zip",)"
       u8R"("zipex":"96910,96931",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"en~ch")"
-      "}"));
-  region_data.insert(std::make_pair("GW", "{"
+      "}");
+  region_data.emplace("GW", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1000,1011",)"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("GY", "{"
+      "}");
+  region_data.emplace("GY", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("HK", "{"
+      "}");
+  region_data.emplace("HK", "{"
       u8R"("fmt":"%S%n%C%n%A%n%O%n%N",)"
       u8R"("lfmt":"%N%n%O%n%A%n%C%n%S",)"
       u8R"("require":"AS",)"
       u8R"("state_name_type":"area",)"
       u8R"("locality_name_type":"district",)"
       u8R"("languages":"zh-Hant~en")"
-      "}"));
-  region_data.insert(std::make_pair("HM", "{"
+      "}");
+  region_data.emplace("HM", "{"
       u8R"("fmt":"%O%n%N%n%A%n%C %S %Z",)"
       u8R"("zipex":"7050")"
-      "}"));
-  region_data.insert(std::make_pair("HN", "{"
+      "}");
+  region_data.emplace("HN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S%n%Z",)"
       u8R"("require":"ACS",)"
       u8R"("zipex":"31301",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("HR", "{"
+      "}");
+  region_data.emplace("HR", "{"
       u8R"("fmt":"%N%n%O%n%A%nHR-%Z %C",)"
       u8R"("zipex":"10000,21001,10002",)"
       u8R"("posturl":"http://www.posta.hr/default.aspx?pretpum",)"
       u8R"("languages":"hr~it")"
-      "}"));
-  region_data.insert(std::make_pair("HT", "{"
+      "}");
+  region_data.emplace("HT", "{"
       u8R"("fmt":"%N%n%O%n%A%nHT%Z %C",)"
       u8R"("zipex":"6120,5310,6110,8510",)"
       u8R"("languages":"ht~fr")"
-      "}"));
-  region_data.insert(std::make_pair("HU", "{"
+      "}");
+  region_data.emplace("HU", "{"
       u8R"("fmt":"%N%n%O%n%C%n%A%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"1037,2380,1540",)"
       u8R"("posturl":"http://posta.hu/ugyfelszolgalat/iranyitoszam_kereso",)"
       u8R"("languages":"hu")"
-      "}"));
-  region_data.insert(std::make_pair("ID", "{"
+      "}");
+  region_data.emplace("ID", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S %Z",)"
       u8R"("require":"AS",)"
       u8R"("zipex":"40115",)"
       u8R"("languages":"id")"
-      "}"));
-  region_data.insert(std::make_pair("IE", "{"
+      "}");
+  region_data.emplace("IE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D%n%C%n%S %Z",)"
       u8R"("zip_name_type":"eircode",)"
       u8R"("state_name_type":"county",)"
@@ -585,21 +590,21 @@
       u8R"("zipex":"A65 F4E2",)"
       u8R"("posturl":"https://finder.eircode.ie",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("IL", "{"
+      "}");
+  region_data.emplace("IL", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"9614303",)"
       u8R"("posturl":"http://www.israelpost.co.il/zipcode.nsf/demozip?openform",)"
       u8R"("languages":"iw~ar")"
-      "}"));
-  region_data.insert(std::make_pair("IM", "{"
+      "}");
+  region_data.emplace("IM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"IM2 1AA,IM99 1PS",)"
       u8R"("posturl":"http://www.gov.im/post/postal/fr_main.asp",)"
       u8R"("languages":"en~gv")"
-      "}"));
-  region_data.insert(std::make_pair("IN", "{"
+      "}");
+  region_data.emplace("IN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z%n%S",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"pin",)"
@@ -607,95 +612,100 @@
       u8R"("zipex":"110034,110001",)"
       u8R"("posturl":"https://www.indiapost.gov.in/vas/pages/FindPinCode.aspx",)"
       u8R"("languages":"en~hi")"
-      "}"));
-  region_data.insert(std::make_pair("IO", "{"
+      "}");
+  region_data.emplace("IO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"BBND 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("IQ", "{"
+      "}");
+  region_data.emplace("IQ", "{"
       u8R"("fmt":"%O%n%N%n%A%n%C, %S%n%Z",)"
       u8R"("require":"ACS",)"
       u8R"("zipex":"31001",)"
       u8R"("languages":"ar~ckb~az-Arab")"
-      "}"));
-  region_data.insert(std::make_pair("IR", "{"
+      "}");
+  region_data.emplace("IR", "{"
       u8R"("fmt":"%O%n%N%n%S%n%C, %D%n%A%n%Z",)"
       u8R"("sublocality_name_type":"neighborhood",)"
       u8R"("zipex":"11936-12345",)"
       u8R"("languages":"fa")"
-      "}"));
-  region_data.insert(std::make_pair("IS", "{"
+      "}");
+  region_data.emplace("IS", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"320,121,220,110",)"
       u8R"("posturl":"http://www.postur.is/einstaklingar/posthus/postnumer/",)"
       u8R"("languages":"is")"
-      "}"));
-  region_data.insert(std::make_pair("IT", "{"
+      "}");
+  region_data.emplace("IT", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C %S",)"
       u8R"("require":"ACSZ",)"
       u8R"("zipex":"00144,47037,39049",)"
       u8R"("posturl":"http://www.poste.it/online/cercacap/",)"
       u8R"("languages":"it")"
-      "}"));
-  region_data.insert(std::make_pair("JE", "{"
+      "}");
+  region_data.emplace("JE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%nJERSEY%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"JE1 1AA,JE2 2BT",)"
       u8R"("posturl":"http://www.jerseypost.com/tools/postcode-address-finder/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("JM", "{"
+      "}");
+  region_data.emplace("JM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S %X",)"
       u8R"("require":"ACS",)"
       u8R"("state_name_type":"parish",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("JO", "{"
+      "}");
+  region_data.emplace("JO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"11937,11190",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("JP", "{"
-      u8R"("fmt":"〒%Z%n%S%C%n%A%n%O%n%N",)"
-      u8R"("lfmt":"%N%n%O%n%A%n%C, %S%n%Z",)"
-      u8R"("require":"ACSZ",)"
+      "}");
+  region_data.emplace("JP", "{"
+      u8R"("fmt":"〒%Z%n%S%n%A%n%O%n%N",)"
+      u8R"("lfmt":"%N%n%O%n%A, %S%n%Z",)"
+      u8R"("require":"ASZ",)"
       u8R"("state_name_type":"prefecture",)"
       u8R"("zipex":"154-0023,350-1106,951-8073,112-0001,208-0032,231-0012",)"
       u8R"("posturl":"http://www.post.japanpost.jp/zipcode/",)"
       u8R"("languages":"ja")"
-      "}"));
-  region_data.insert(std::make_pair("KE", "{"
+      "}");
+  region_data.emplace("KE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"20100,00100",)"
       u8R"("languages":"sw~en")"
-      "}"));
-  region_data.insert(std::make_pair("KG", "{"
+      "}");
+  region_data.emplace("KG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"720001",)"
       u8R"("languages":"ky~ru")"
-      "}"));
-  region_data.insert(std::make_pair("KH", "{"
+      "}");
+  region_data.emplace("KH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"12203,14206,12000",)"
       u8R"("languages":"km")"
-      "}"));
-  region_data.insert(std::make_pair("KI", "{"
+      "}");
+  region_data.emplace("KI", "{"
       u8R"("fmt":"%N%n%O%n%A%n%S%n%C",)"
       u8R"("state_name_type":"island",)"
       u8R"("languages":"en~gil")"
-      "}"));
-  region_data.insert(std::make_pair("KM", "{"
+      "}");
+  region_data.emplace("KM", "{"
       u8R"("languages":"ar~fr~zdj~wni")"
-      "}"));
-  region_data.insert(std::make_pair("KN", "{"
+      "}");
+  region_data.emplace("KN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S",)"
       u8R"("require":"ACS",)"
       u8R"("state_name_type":"island",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("KR", "{"
+      "}");
+  region_data.emplace("KP", "{"
+      u8R"("fmt":"%Z%n%S%n%C%n%A%n%O%n%N",)"
+      u8R"("lfmt":"%N%n%O%n%A%n%C%n%S, %Z",)"
+      u8R"("languages":"ko")"
+      "}");
+  region_data.emplace("KR", "{"
       u8R"("fmt":"%S %C%D%n%A%n%O%n%N%n%Z",)"
       u8R"("lfmt":"%N%n%O%n%A%n%D%n%C%n%S%n%Z",)"
       u8R"("require":"ACSZ",)"
@@ -704,116 +714,116 @@
       u8R"("zipex":"03051",)"
       u8R"("posturl":"http://www.epost.go.kr/search/zipcode/search5.jsp",)"
       u8R"("languages":"ko")"
-      "}"));
-  region_data.insert(std::make_pair("KW", "{"
+      "}");
+  region_data.emplace("KW", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"54541,54551,54404,13009",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("KY", "{"
+      "}");
+  region_data.emplace("KY", "{"
       u8R"("fmt":"%N%n%O%n%A%n%S %Z",)"
       u8R"("require":"AS",)"
       u8R"("state_name_type":"island",)"
       u8R"("zipex":"KY1-1100,KY1-1702,KY2-2101",)"
       u8R"("posturl":"http://www.caymanpost.gov.ky/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("KZ", "{"
+      "}");
+  region_data.emplace("KZ", "{"
       u8R"("fmt":"%Z%n%S%n%C%n%A%n%O%n%N",)"
       u8R"("zipex":"040900,050012",)"
       u8R"("languages":"ru~kk")"
-      "}"));
-  region_data.insert(std::make_pair("LA", "{"
+      "}");
+  region_data.emplace("LA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"01160,01000",)"
       u8R"("languages":"lo")"
-      "}"));
-  region_data.insert(std::make_pair("LB", "{"
+      "}");
+  region_data.emplace("LB", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"2038 3054,1107 2810,1000",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("LC", "{"
+      "}");
+  region_data.emplace("LC", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("LI", "{"
+      "}");
+  region_data.emplace("LI", "{"
       u8R"("fmt":"%O%n%N%n%A%nFL-%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"9496,9491,9490,9485",)"
       u8R"("posturl":"http://www.post.ch/db/owa/pv_plz_pack/pr_main",)"
       u8R"("languages":"de~gsw")"
-      "}"));
-  region_data.insert(std::make_pair("LK", "{"
+      "}");
+  region_data.emplace("LK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"20000,00100",)"
       u8R"("posturl":"http://www.slpost.gov.lk/",)"
       u8R"("languages":"si~ta")"
-      "}"));
-  region_data.insert(std::make_pair("LR", "{"
+      "}");
+  region_data.emplace("LR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1000",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("LS", "{"
+      "}");
+  region_data.emplace("LS", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"100",)"
       u8R"("languages":"st~en")"
-      "}"));
-  region_data.insert(std::make_pair("LT", "{"
+      "}");
+  region_data.emplace("LT", "{"
       u8R"("fmt":"%O%n%N%n%A%nLT-%Z %C",)"
       u8R"("zipex":"04340,03500",)"
       u8R"("posturl":"http://www.post.lt/lt/?id=316",)"
       u8R"("languages":"lt")"
-      "}"));
-  region_data.insert(std::make_pair("LU", "{"
+      "}");
+  region_data.emplace("LU", "{"
       u8R"("fmt":"%O%n%N%n%A%nL-%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"4750,2998",)"
       u8R"("posturl":"https://www.post.lu/fr/grandes-entreprises/solutions-postales/rechercher-un-code-postal",)"
       u8R"("languages":"fr~lb~de")"
-      "}"));
-  region_data.insert(std::make_pair("LV", "{"
+      "}");
+  region_data.emplace("LV", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %Z",)"
       u8R"("zipex":"LV-1073,LV-1000",)"
       u8R"("posturl":"http://www.pasts.lv/lv/uzzinas/nodalas/",)"
       u8R"("languages":"lv")"
-      "}"));
-  region_data.insert(std::make_pair("LY", "{"
+      "}");
+  region_data.emplace("LY", "{"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("MA", "{"
+      "}");
+  region_data.emplace("MA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"53000,10000,20050,16052",)"
       u8R"("languages":"ar~fr~tzm")"
-      "}"));
-  region_data.insert(std::make_pair("MC", "{"
+      "}");
+  region_data.emplace("MC", "{"
       u8R"("fmt":"%N%n%O%n%A%nMC-%Z %C %X",)"
       u8R"("zipex":"98000,98020,98011,98001",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("MD", "{"
+      "}");
+  region_data.emplace("MD", "{"
       u8R"("fmt":"%N%n%O%n%A%nMD-%Z %C",)"
       u8R"("zipex":"2012,2019",)"
       u8R"("languages":"ro")"
-      "}"));
-  region_data.insert(std::make_pair("ME", "{"
+      "}");
+  region_data.emplace("ME", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"81257,81258,81217,84314,85366",)"
       u8R"("languages":"sr-Latn")"
-      "}"));
-  region_data.insert(std::make_pair("MF", "{"
+      "}");
+  region_data.emplace("MF", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97100",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("MG", "{"
+      "}");
+  region_data.emplace("MG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"501,101",)"
       u8R"("languages":"mg~fr~en")"
-      "}"));
-  region_data.insert(std::make_pair("MH", "{"
+      "}");
+  region_data.emplace("MH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -821,33 +831,33 @@
       u8R"("zipex":"96960,96970",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"en~mh")"
-      "}"));
-  region_data.insert(std::make_pair("MK", "{"
+      "}");
+  region_data.emplace("MK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1314,1321,1443,1062",)"
       u8R"("languages":"mk~sq")"
-      "}"));
-  region_data.insert(std::make_pair("ML", "{"
+      "}");
+  region_data.emplace("ML", "{"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("MM", "{"
+      "}");
+  region_data.emplace("MM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %Z",)"
       u8R"("zipex":"11181",)"
       u8R"("languages":"my")"
-      "}"));
-  region_data.insert(std::make_pair("MN", "{"
+      "}");
+  region_data.emplace("MN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S %Z",)"
       u8R"("zipex":"65030,65270",)"
       u8R"("posturl":"http://www.zipcode.mn/",)"
       u8R"("languages":"mn")"
-      "}"));
-  region_data.insert(std::make_pair("MO", "{"
+      "}");
+  region_data.emplace("MO", "{"
       u8R"("fmt":"%A%n%O%n%N",)"
       u8R"("lfmt":"%N%n%O%n%A",)"
       u8R"("require":"A",)"
       u8R"("languages":"zh-Hant~pt")"
-      "}"));
-  region_data.insert(std::make_pair("MP", "{"
+      "}");
+  region_data.emplace("MP", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -855,42 +865,42 @@
       u8R"("zipex":"96950,96951,96952",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("MQ", "{"
+      "}");
+  region_data.emplace("MQ", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97220",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("MR", "{"
+      "}");
+  region_data.emplace("MR", "{"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("MS", "{"
+      "}");
+  region_data.emplace("MS", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("MT", "{"
+      "}");
+  region_data.emplace("MT", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"NXR 01,ZTN 05,GPO 01,BZN 1130,SPB 6031,VCT 1753",)"
       u8R"("posturl":"http://postcodes.maltapost.com/",)"
       u8R"("languages":"mt~en")"
-      "}"));
-  region_data.insert(std::make_pair("MU", "{"
+      "}");
+  region_data.emplace("MU", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z%n%C",)"
       u8R"("zipex":"42602",)"
       u8R"("languages":"en~fr")"
-      "}"));
-  region_data.insert(std::make_pair("MV", "{"
+      "}");
+  region_data.emplace("MV", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"20026",)"
       u8R"("posturl":"http://www.maldivespost.com/?lid=10",)"
       u8R"("languages":"dv")"
-      "}"));
-  region_data.insert(std::make_pair("MW", "{"
+      "}");
+  region_data.emplace("MW", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %X",)"
       u8R"("languages":"en~ny")"
-      "}"));
-  region_data.insert(std::make_pair("MX", "{"
+      "}");
+  region_data.emplace("MX", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D%n%Z %C, %S",)"
       u8R"("require":"ACZ",)"
       u8R"("state_name_type":"state",)"
@@ -898,8 +908,8 @@
       u8R"("zipex":"02860,77520,06082",)"
       u8R"("posturl":"http://www.correosdemexico.gob.mx/ServiciosLinea/Paginas/ccpostales.aspx",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("MY", "{"
+      "}");
+  region_data.emplace("MY", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D%n%Z %C%n%S",)"
       u8R"("require":"ACZ",)"
       u8R"("state_name_type":"state",)"
@@ -907,161 +917,161 @@
       u8R"("zipex":"43000,50754,88990,50670",)"
       u8R"("posturl":"http://www.pos.com.my",)"
       u8R"("languages":"ms")"
-      "}"));
-  region_data.insert(std::make_pair("MZ", "{"
-      u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
+      "}");
+  region_data.emplace("MZ", "{"
+      u8R"("fmt":"%N%n%O%n%A%n%Z %C%S",)"
       u8R"("zipex":"1102,1119,3212",)"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("NA", "{"
+      "}");
+  region_data.emplace("NA", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("NC", "{"
+      "}");
+  region_data.emplace("NC", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"98814,98800,98810",)"
       u8R"("posturl":"http://poste.opt.nc/index.php?option=com_content&view=article&id=80&Itemid=131",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("NE", "{"
+      "}");
+  region_data.emplace("NE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"8001",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("NF", "{"
+      "}");
+  region_data.emplace("NF", "{"
       u8R"("fmt":"%O%n%N%n%A%n%C %S %Z",)"
       u8R"("zipex":"2899",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("NG", "{"
+      "}");
+  region_data.emplace("NG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D%n%C %Z%n%S",)"
       u8R"("state_name_type":"state",)"
       u8R"("zipex":"930283,300001,931104",)"
       u8R"("posturl":"http://www.nigeriapostcodes.com/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("NI", "{"
+      "}");
+  region_data.emplace("NI", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z%n%C, %S",)"
       u8R"("state_name_type":"department",)"
       u8R"("zipex":"52000",)"
       u8R"("posturl":"http://www.correos.gob.ni/index.php/codigo-postal-2",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("NL", "{"
+      "}");
+  region_data.emplace("NL", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"1234 AB,2490 AA",)"
       u8R"("posturl":"http://www.postnl.nl/voorthuis/",)"
       u8R"("languages":"nl~fy")"
-      "}"));
-  region_data.insert(std::make_pair("NO", "{"
+      "}");
+  region_data.emplace("NO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("locality_name_type":"post_town",)"
       u8R"("zipex":"0025,0107,6631",)"
       u8R"("posturl":"http://adressesok.posten.no/nb/postal_codes/search",)"
       u8R"("languages":"no~nn~se")"
-      "}"));
-  region_data.insert(std::make_pair("NP", "{"
+      "}");
+  region_data.emplace("NP", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"44601",)"
       u8R"("posturl":"http://www.gpo.gov.np/postalcode.aspx",)"
       u8R"("languages":"ne")"
-      "}"));
-  region_data.insert(std::make_pair("NR", "{"
+      "}");
+  region_data.emplace("NR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%S",)"
       u8R"("require":"AS",)"
       u8R"("state_name_type":"district",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("NU", "{"
+      "}");
+  region_data.emplace("NU", "{"
       u8R"("languages":"en~niu")"
-      "}"));
-  region_data.insert(std::make_pair("NZ", "{"
+      "}");
+  region_data.emplace("NZ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D%n%C %Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"6001,6015,6332,8252,1030",)"
       u8R"("posturl":"http://www.nzpost.co.nz/Cultures/en-NZ/OnlineTools/PostCodeFinder/",)"
       u8R"("languages":"en~mi")"
-      "}"));
-  region_data.insert(std::make_pair("OM", "{"
+      "}");
+  region_data.emplace("OM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z%n%C",)"
       u8R"("zipex":"133,112,111",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("PA", "{"
+      "}");
+  region_data.emplace("PA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("PE", "{"
+      "}");
+  region_data.emplace("PE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z%n%S",)"
       u8R"("zipex":"LIMA 23,LIMA 42,CALLAO 2,02001",)"
       u8R"("posturl":"http://www.serpost.com.pe/cpostal/codigo",)"
       u8R"("languages":"es~qu")"
-      "}"));
-  region_data.insert(std::make_pair("PF", "{"
+      "}");
+  region_data.emplace("PF", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C %S",)"
       u8R"("require":"ACSZ",)"
       u8R"("state_name_type":"island",)"
       u8R"("zipex":"98709",)"
       u8R"("languages":"fr~ty")"
-      "}"));
-  region_data.insert(std::make_pair("PG", "{"
+      "}");
+  region_data.emplace("PG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z %S",)"
       u8R"("require":"ACS",)"
       u8R"("zipex":"111",)"
       u8R"("languages":"tpi~en~ho")"
-      "}"));
-  region_data.insert(std::make_pair("PH", "{"
+      "}");
+  region_data.emplace("PH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D, %C%n%Z %S",)"
       u8R"("zipex":"1008,1050,1135,1207,2000,1000",)"
       u8R"("posturl":"http://www.philpost.gov.ph/",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("PK", "{"
+      "}");
+  region_data.emplace("PK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C-%Z",)"
       u8R"("zipex":"44000",)"
       u8R"("posturl":"http://www.pakpost.gov.pk/postcode/postcode.html",)"
       u8R"("languages":"ur~en")"
-      "}"));
-  region_data.insert(std::make_pair("PL", "{"
+      "}");
+  region_data.emplace("PL", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"00-950,05-470,48-300,32-015,00-940",)"
       u8R"("posturl":"http://kody.poczta-polska.pl/",)"
       u8R"("languages":"pl~de~csb~lt")"
-      "}"));
-  region_data.insert(std::make_pair("PM", "{"
+      "}");
+  region_data.emplace("PM", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97500",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("PN", "{"
+      "}");
+  region_data.emplace("PN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"PCRN 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("PR", "{"
+      "}");
+  region_data.emplace("PR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C PR %Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zip_name_type":"zip",)"
       u8R"("zipex":"00930",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"es~en")"
-      "}"));
-  region_data.insert(std::make_pair("PS", "{"
+      "}");
+  region_data.emplace("PS", "{"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("PT", "{"
+      "}");
+  region_data.emplace("PT", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"2725-079,1250-096,1201-950,2860-571,1208-148",)"
       u8R"("posturl":"http://www.ctt.pt/feapl_2/app/open/tools.jspx?tool=1",)"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("PW", "{"
+      "}");
+  region_data.emplace("PW", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -1069,35 +1079,35 @@
       u8R"("zipex":"96940",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"pau~en")"
-      "}"));
-  region_data.insert(std::make_pair("PY", "{"
+      "}");
+  region_data.emplace("PY", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1536,1538,1209",)"
       u8R"("languages":"gn~es")"
-      "}"));
-  region_data.insert(std::make_pair("QA", "{"
+      "}");
+  region_data.emplace("QA", "{"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("RE", "{"
+      "}");
+  region_data.emplace("RE", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97400",)"
       u8R"("posturl":"http://www.laposte.fr/Particulier/Utiliser-nos-outils-pratiques/Outils-et-documents/Trouvez-un-code-postal",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("RO", "{"
+      "}");
+  region_data.emplace("RO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"060274,061357,200716",)"
       u8R"("posturl":"http://www.posta-romana.ro/zip_codes",)"
       u8R"("languages":"ro")"
-      "}"));
-  region_data.insert(std::make_pair("RS", "{"
+      "}");
+  region_data.emplace("RS", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"106314",)"
       u8R"("posturl":"http://www.posta.rs/struktura/lat/aplikacije/pronadji/nadji-postu.asp",)"
       u8R"("languages":"sr~sr-Latn~hu~ro~hr~sk~uk")"
-      "}"));
-  region_data.insert(std::make_pair("RU", "{"
+      "}");
+  region_data.emplace("RU", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S%n%Z",)"
       u8R"("lfmt":"%N%n%O%n%A%n%C%n%S%n%Z",)"
       u8R"("require":"ACSZ",)"
@@ -1105,177 +1115,187 @@
       u8R"("zipex":"247112,103375,188300",)"
       u8R"("posturl":"http://info.russianpost.ru/servlet/department",)"
       u8R"("languages":"ru")"
-      "}"));
-  region_data.insert(std::make_pair("RW", "{"
+      "}");
+  region_data.emplace("RW", "{"
       u8R"("languages":"rw~en~fr")"
-      "}"));
-  region_data.insert(std::make_pair("SA", "{"
+      "}");
+  region_data.emplace("SA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"11564,11187,11142",)"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("SB", "{"
+      "}");
+  region_data.emplace("SB", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("SC", "{"
+      "}");
+  region_data.emplace("SC", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S",)"
       u8R"("state_name_type":"island",)"
       u8R"("languages":"fr~en")"
-      "}"));
-  region_data.insert(std::make_pair("SE", "{"
+      "}");
+  region_data.emplace("SD", "{"
+      u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
+      u8R"("locality_name_type":"district",)"
+      u8R"("zipex":"11042,11113",)"
+      u8R"("languages":"ar~en")"
+      "}");
+  region_data.emplace("SE", "{"
       u8R"("fmt":"%O%n%N%n%A%nSE-%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("locality_name_type":"post_town",)"
       u8R"("zipex":"11455,12345,10500",)"
       u8R"("posturl":"http://www.posten.se/sv/Kundservice/Sidor/Sok-postnummer-resultat.aspx",)"
       u8R"("languages":"sv~fi")"
-      "}"));
-  region_data.insert(std::make_pair("SG", "{"
+      "}");
+  region_data.emplace("SG", "{"
       u8R"("fmt":"%N%n%O%n%A%nSINGAPORE %Z",)"
       u8R"("require":"AZ",)"
       u8R"("zipex":"546080,308125,408600",)"
       u8R"("posturl":"https://www.singpost.com/find-postal-code",)"
       u8R"("languages":"en~zh~ms~ta")"
-      "}"));
-  region_data.insert(std::make_pair("SH", "{"
+      "}");
+  region_data.emplace("SH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"STHL 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("SI", "{"
-      u8R"("fmt":"%N%n%O%n%A%nSI- %Z %C",)"
+      "}");
+  region_data.emplace("SI", "{"
+      u8R"("fmt":"%N%n%O%n%A%nSI-%Z %C",)"
       u8R"("zipex":"4000,1001,2500",)"
       u8R"("languages":"sl")"
-      "}"));
-  region_data.insert(std::make_pair("SJ", "{"
+      "}");
+  region_data.emplace("SJ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"ACZ",)"
       u8R"("locality_name_type":"post_town",)"
       u8R"("zipex":"9170",)"
       u8R"("posturl":"http://epab.posten.no/",)"
       u8R"("languages":"no")"
-      "}"));
-  region_data.insert(std::make_pair("SK", "{"
+      "}");
+  region_data.emplace("SK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
+      u8R"("require":"ACZ",)"
       u8R"("zipex":"010 01,023 14,972 48,921 01,975 99",)"
       u8R"("posturl":"http://psc.posta.sk",)"
       u8R"("languages":"sk")"
-      "}"));
-  region_data.insert(std::make_pair("SL", "{"
+      "}");
+  region_data.emplace("SL", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("SM", "{"
+      "}");
+  region_data.emplace("SM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("require":"AZ",)"
       u8R"("zipex":"47890,47891,47895,47899",)"
       u8R"("posturl":"http://www.poste.it/online/cercacap/",)"
       u8R"("languages":"it")"
-      "}"));
-  region_data.insert(std::make_pair("SN", "{"
+      "}");
+  region_data.emplace("SN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"12500,46024,16556,10000",)"
       u8R"("languages":"wo~fr~ff~srr~dyo~sav~mfv~bjt~snf~knf~bsc~mey~tnr")"
-      "}"));
-  region_data.insert(std::make_pair("SO", "{"
+      "}");
+  region_data.emplace("SO", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S %Z",)"
       u8R"("require":"ACS",)"
       u8R"("zipex":"JH 09010,AD 11010",)"
       u8R"("languages":"so")"
-      "}"));
-  region_data.insert(std::make_pair("SR", "{"
+      "}");
+  region_data.emplace("SR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S",)"
       u8R"("languages":"nl")"
-      "}"));
-  region_data.insert(std::make_pair("SS", "{"
+      "}");
+  region_data.emplace("SS", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("ST", "{"
+      "}");
+  region_data.emplace("ST", "{"
       u8R"("languages":"pt")"
-      "}"));
-  region_data.insert(std::make_pair("SV", "{"
+      "}");
+  region_data.emplace("SV", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z-%C%n%S",)"
       u8R"("require":"ACS",)"
       u8R"("zipex":"CP 1101",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("SX", "{"
+      "}");
+  region_data.emplace("SX", "{"
       u8R"("languages":"en~nl")"
-      "}"));
-  region_data.insert(std::make_pair("SZ", "{"
+      "}");
+  region_data.emplace("SY", "{"
+      u8R"("languages":"ar~fr")"
+      "}");
+  region_data.emplace("SZ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"H100",)"
       u8R"("posturl":"http://www.sptc.co.sz/swazipost/codes/index.php",)"
       u8R"("languages":"en~ss")"
-      "}"));
-  region_data.insert(std::make_pair("TA", "{"
+      "}");
+  region_data.emplace("TA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("zipex":"TDCU 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("TC", "{"
+      "}");
+  region_data.emplace("TC", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"TKCA 1ZZ",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("TD", "{"
+      "}");
+  region_data.emplace("TD", "{"
       u8R"("languages":"fr~ar")"
-      "}"));
-  region_data.insert(std::make_pair("TF", "{"
+      "}");
+  region_data.emplace("TF", "{"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("TG", "{"
+      "}");
+  region_data.emplace("TG", "{"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("TH", "{"
+      "}");
+  region_data.emplace("TH", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D %C%n%S %Z",)"
       u8R"("lfmt":"%N%n%O%n%A%n%D, %C%n%S %Z",)"
       u8R"("zipex":"10150,10210",)"
       u8R"("languages":"th")"
-      "}"));
-  region_data.insert(std::make_pair("TJ", "{"
+      "}");
+  region_data.emplace("TJ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"735450,734025",)"
       u8R"("languages":"tg")"
-      "}"));
-  region_data.insert(std::make_pair("TK", "{"
+      "}");
+  region_data.emplace("TK", "{"
       u8R"("languages":"en~tkl")"
-      "}"));
-  region_data.insert(std::make_pair("TL", "{"
+      "}");
+  region_data.emplace("TL", "{"
       u8R"("languages":"pt~tet")"
-      "}"));
-  region_data.insert(std::make_pair("TM", "{"
+      "}");
+  region_data.emplace("TM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"744000",)"
       u8R"("languages":"tk")"
-      "}"));
-  region_data.insert(std::make_pair("TN", "{"
+      "}");
+  region_data.emplace("TN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"1002,8129,3100,1030",)"
       u8R"("posturl":"http://www.poste.tn/codes.php",)"
       u8R"("languages":"ar~fr")"
-      "}"));
-  region_data.insert(std::make_pair("TO", "{"
+      "}");
+  region_data.emplace("TO", "{"
       u8R"("languages":"to~en")"
-      "}"));
-  region_data.insert(std::make_pair("TR", "{"
+      "}");
+  region_data.emplace("TR", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C/%S",)"
       u8R"("require":"ACZ",)"
       u8R"("locality_name_type":"district",)"
       u8R"("zipex":"01960,06101",)"
       u8R"("posturl":"http://postakodu.ptt.gov.tr/",)"
       u8R"("languages":"tr")"
-      "}"));
-  region_data.insert(std::make_pair("TT", "{"
+      "}");
+  region_data.emplace("TT", "{"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("TV", "{"
+      "}");
+  region_data.emplace("TV", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S",)"
       u8R"("state_name_type":"island",)"
       u8R"("languages":"tyv")"
-      "}"));
-  region_data.insert(std::make_pair("TW", "{"
+      "}");
+  region_data.emplace("TW", "{"
       u8R"("fmt":"%Z%n%S%C%n%A%n%O%n%N",)"
       u8R"("lfmt":"%N%n%O%n%A%n%C, %S %Z",)"
       u8R"("require":"ACSZ",)"
@@ -1283,13 +1303,13 @@
       u8R"("zipex":"104,106,10603,40867",)"
       u8R"("posturl":"http://www.post.gov.tw/post/internet/f_searchzone/index.jsp?ID=190102",)"
       u8R"("languages":"zh-Hant")"
-      "}"));
-  region_data.insert(std::make_pair("TZ", "{"
+      "}");
+  region_data.emplace("TZ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"6090,34413",)"
       u8R"("languages":"sw~en")"
-      "}"));
-  region_data.insert(std::make_pair("UA", "{"
+      "}");
+  region_data.emplace("UA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S%n%Z",)"
       u8R"("lfmt":"%N%n%O%n%A%n%C%n%S%n%Z",)"
       u8R"("require":"ACSZ",)"
@@ -1297,11 +1317,11 @@
       u8R"("zipex":"15432,01055,01001",)"
       u8R"("posturl":"http://services.ukrposhta.com/postindex_new/",)"
       u8R"("languages":"uk")"
-      "}"));
-  region_data.insert(std::make_pair("UG", "{"
+      "}");
+  region_data.emplace("UG", "{"
       u8R"("languages":"sw~en")"
-      "}"));
-  region_data.insert(std::make_pair("UM", "{"
+      "}");
+  region_data.emplace("UM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACS",)"
       u8R"("zip_name_type":"zip",)"
@@ -1309,8 +1329,8 @@
       u8R"("zipex":"96898",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("US", "{"
+      "}");
+  region_data.emplace("US", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C, %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -1318,45 +1338,45 @@
       u8R"("zipex":"95014,22162-1010",)"
       u8R"("posturl":"https://tools.usps.com/go/ZipLookupAction!input.action",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("UY", "{"
+      "}");
+  region_data.emplace("UY", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C %S",)"
       u8R"("zipex":"11600",)"
       u8R"("posturl":"http://www.correo.com.uy/index.asp?codPag=codPost&switchMapa=codPost",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("UZ", "{"
+      "}");
+  region_data.emplace("UZ", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C%n%S",)"
       u8R"("zipex":"702100,700000",)"
       u8R"("posturl":"http://www.pochta.uz/ru/uslugi/indexsearch.html",)"
       u8R"("languages":"uz~uz-Cyrl")"
-      "}"));
-  region_data.insert(std::make_pair("VA", "{"
+      "}");
+  region_data.emplace("VA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"00120",)"
       u8R"("languages":"it")"
-      "}"));
-  region_data.insert(std::make_pair("VC", "{"
+      "}");
+  region_data.emplace("VC", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z",)"
       u8R"("zipex":"VC0100,VC0110,VC0400",)"
       u8R"("posturl":"http://www.svgpost.gov.vc/?option=com_content&view=article&id=3&Itemid=16",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("VE", "{"
+      "}");
+  region_data.emplace("VE", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %Z, %S",)"
       u8R"("require":"ACS",)"
       u8R"("state_name_type":"state",)"
       u8R"("zipex":"1010,3001,8011,1020",)"
       u8R"("posturl":"http://www.ipostel.gob.ve/index.php/oficinas-postales",)"
       u8R"("languages":"es")"
-      "}"));
-  region_data.insert(std::make_pair("VG", "{"
+      "}");
+  region_data.emplace("VG", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%Z",)"
       u8R"("require":"A",)"
       u8R"("zipex":"VG1110,VG1150,VG1160",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("VI", "{"
+      "}");
+  region_data.emplace("VI", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C %S %Z",)"
       u8R"("require":"ACSZ",)"
       u8R"("zip_name_type":"zip",)"
@@ -1364,55 +1384,55 @@
       u8R"("zipex":"00802-1222,00850-9802",)"
       u8R"("posturl":"http://zip4.usps.com/zip4/welcome.jsp",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("VN", "{"
+      "}");
+  region_data.emplace("VN", "{"
       u8R"("fmt":"%N%n%O%n%A%n%C%n%S %Z",)"
       u8R"("lfmt":"%N%n%O%n%A%n%C%n%S %Z",)"
-      u8R"("zipex":"119415,136065,720344",)"
+      u8R"("zipex":"70010,55999",)"
       u8R"("posturl":"http://postcode.vnpost.vn/services/search.aspx",)"
       u8R"("languages":"vi")"
-      "}"));
-  region_data.insert(std::make_pair("VU", "{"
+      "}");
+  region_data.emplace("VU", "{"
       u8R"("languages":"bi~en~fr")"
-      "}"));
-  region_data.insert(std::make_pair("WF", "{"
+      "}");
+  region_data.emplace("WF", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"98600",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("WS", "{"
+      "}");
+  region_data.emplace("WS", "{"
       u8R"("languages":"sm~en")"
-      "}"));
-  region_data.insert(std::make_pair("XK", "{"
+      "}");
+  region_data.emplace("XK", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"10000",)"
       u8R"("languages":"sq~sr~sr-Latn")"
-      "}"));
-  region_data.insert(std::make_pair("YE", "{"
+      "}");
+  region_data.emplace("YE", "{"
       u8R"("languages":"ar")"
-      "}"));
-  region_data.insert(std::make_pair("YT", "{"
+      "}");
+  region_data.emplace("YT", "{"
       u8R"("fmt":"%O%n%N%n%A%n%Z %C %X",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"97600",)"
       u8R"("languages":"fr")"
-      "}"));
-  region_data.insert(std::make_pair("ZA", "{"
+      "}");
+  region_data.emplace("ZA", "{"
       u8R"("fmt":"%N%n%O%n%A%n%D%n%C%n%Z",)"
       u8R"("require":"ACZ",)"
       u8R"("zipex":"0083,1451,0001",)"
       u8R"("posturl":"https://www.postoffice.co.za/contactus/postalcode.html",)"
       u8R"("languages":"en~zu~xh~af~nso~tn~st~ts~ss~ve~nr")"
-      "}"));
-  region_data.insert(std::make_pair("ZM", "{"
+      "}");
+  region_data.emplace("ZM", "{"
       u8R"("fmt":"%N%n%O%n%A%n%Z %C",)"
       u8R"("zipex":"50100,50101",)"
       u8R"("languages":"en")"
-      "}"));
-  region_data.insert(std::make_pair("ZW", "{"
+      "}");
+  region_data.emplace("ZW", "{"
       u8R"("languages":"sn~en~nd")"
-      "}"));
+      "}");
   return region_data;
 }
 
@@ -1457,15 +1477,14 @@
 
 const std::map<std::string, size_t> InitMaxLookupKeyDepth() {
   std::map<std::string, size_t> max_depth;
-  for (std::map<std::string, std::string>::const_iterator
-       it = GetAllRegionData().begin(); it != GetAllRegionData().end(); ++it) {
+  for (const auto& pair : GetAllRegionData()) {
     std::vector<FormatElement> fields;
-    // Here it->second actually contains the entire JSON blob for this region,
+    // Here pair.second actually contains the entire JSON blob for this region,
     // and not only the format field, but it doesn't really matter when just
     // checking whether a particular formatting code (eg. "%C") is present, as
     // there isn't anything else in the JSON that erroneously could match a
     // formatting code.
-    ParseFormatRule(it->second, &fields);
+    ParseFormatRule(pair.second, &fields);
     size_t depth = 1;
     for (; depth < size(LookupKey::kHierarchy); ++depth) {
       AddressField field = LookupKey::kHierarchy[depth];
@@ -1476,7 +1495,7 @@
         break;
       }
     }
-    max_depth.insert(std::make_pair(it->first, depth - 1));
+    max_depth.emplace(pair.first, depth - 1);
   }
   return max_depth;
 }
@@ -1500,8 +1519,7 @@
 const std::string& RegionDataConstants::GetRegionData(
     const std::string& region_code) {
   static const std::string kEmptyString;
-  std::map<std::string, std::string>::const_iterator it =
-      GetAllRegionData().find(region_code);
+  auto it = GetAllRegionData().find(region_code);
   return it != GetAllRegionData().end() ? it->second : kEmptyString;
 }
 
@@ -1509,8 +1527,7 @@
 size_t RegionDataConstants::GetMaxLookupKeyDepth(
     const std::string& region_code) {
   static const std::map<std::string, size_t> kMaxDepth(InitMaxLookupKeyDepth());
-  std::map<std::string, size_t>::const_iterator it =
-      kMaxDepth.find(region_code);
+  auto it = kMaxDepth.find(region_code);
   return it != kMaxDepth.end() ? it->second : 0;
 }
 
diff --git a/cpp/src/retriever.cc b/cpp/src/retriever.cc
index 67108d0..3d4a24e 100644
--- a/cpp/src/retriever.cc
+++ b/cpp/src/retriever.cc
@@ -52,7 +52,7 @@
   }
 
  private:
-  ~Helper() {}
+  ~Helper() = default;
 
   void OnValidatedDataReady(bool success,
                             const std::string& key,
@@ -107,7 +107,7 @@
   assert(storage_ != nullptr);
 }
 
-Retriever::~Retriever() {}
+Retriever::~Retriever() = default;
 
 void Retriever::Retrieve(const std::string& key,
                          const Callback& retrieved) const {
diff --git a/cpp/src/retriever.h b/cpp/src/retriever.h
index 0c2f0f6..827dbf7 100644
--- a/cpp/src/retriever.h
+++ b/cpp/src/retriever.h
@@ -38,8 +38,8 @@
 //    retriever.Retrieve("data/CA/AB--fr", *retrieved);
 class Retriever {
  public:
-  typedef i18n::addressinput::Callback<const std::string&,
-                                       const std::string&> Callback;
+  using Callback =
+      i18n::addressinput::Callback<const std::string&, const std::string&>;
 
   Retriever(const Retriever&) = delete;
   Retriever& operator=(const Retriever&) = delete;
diff --git a/cpp/src/rule.cc b/cpp/src/rule.cc
index 03b6a4e..2082f3d 100644
--- a/cpp/src/rule.cc
+++ b/cpp/src/rule.cc
@@ -59,13 +59,12 @@
   // Return the message id corresponding to |name|, or INVALID_MESSAGE_ID
   // if it is not found in the map.
   int GetIdFromName(const std::string& name) const {
-    NameIdInfo key = { name.c_str() };
+    NameIdInfo key{name.c_str()};
     const NameIdInfo* begin = infos;
     const NameIdInfo* end = begin + size;
     const NameIdInfo* probe =
         std::lower_bound(begin, end, key, NameIdInfo::less);
-    return (probe != end && name == probe->name)
-        ? probe->id : INVALID_MESSAGE_ID;
+    return probe != end && name == probe->name ? probe->id : INVALID_MESSAGE_ID;
   }
 
   // Return true iff the map is properly sorted.
@@ -80,60 +79,60 @@
 };
 
 const NameIdInfo kAdminAreaInfoArray[] = {
-  {"area", IDS_LIBADDRESSINPUT_AREA},
-  {"county", IDS_LIBADDRESSINPUT_COUNTY},
-  {"department", IDS_LIBADDRESSINPUT_DEPARTMENT},
-  {"district", IDS_LIBADDRESSINPUT_DISTRICT},
-  {"do_si", IDS_LIBADDRESSINPUT_DO_SI},
-  {"emirate", IDS_LIBADDRESSINPUT_EMIRATE},
-  {"island", IDS_LIBADDRESSINPUT_ISLAND},
-  {"oblast", IDS_LIBADDRESSINPUT_OBLAST},
-  {"parish", IDS_LIBADDRESSINPUT_PARISH},
-  {"prefecture", IDS_LIBADDRESSINPUT_PREFECTURE},
-  {"province", IDS_LIBADDRESSINPUT_PROVINCE},
-  {"state", IDS_LIBADDRESSINPUT_STATE},
+    {"area", IDS_LIBADDRESSINPUT_AREA},
+    {"county", IDS_LIBADDRESSINPUT_COUNTY},
+    {"department", IDS_LIBADDRESSINPUT_DEPARTMENT},
+    {"district", IDS_LIBADDRESSINPUT_DISTRICT},
+    {"do_si", IDS_LIBADDRESSINPUT_DO_SI},
+    {"emirate", IDS_LIBADDRESSINPUT_EMIRATE},
+    {"island", IDS_LIBADDRESSINPUT_ISLAND},
+    {"oblast", IDS_LIBADDRESSINPUT_OBLAST},
+    {"parish", IDS_LIBADDRESSINPUT_PARISH},
+    {"prefecture", IDS_LIBADDRESSINPUT_PREFECTURE},
+    {"province", IDS_LIBADDRESSINPUT_PROVINCE},
+    {"state", IDS_LIBADDRESSINPUT_STATE},
 };
 
-const NameIdMap kAdminAreaMessageIds = {
-  kAdminAreaInfoArray,
-  size(kAdminAreaInfoArray)
+const NameIdMap kAdminAreaMessageIds{
+    kAdminAreaInfoArray,
+    size(kAdminAreaInfoArray)
 };
 
 const NameIdInfo kPostalCodeInfoArray[] = {
-  {"eircode", IDS_LIBADDRESSINPUT_EIR_CODE_LABEL},
-  {"pin", IDS_LIBADDRESSINPUT_PIN_CODE_LABEL},
-  {"postal", IDS_LIBADDRESSINPUT_POSTAL_CODE_LABEL},
-  {"zip", IDS_LIBADDRESSINPUT_ZIP_CODE_LABEL},
+    {"eircode", IDS_LIBADDRESSINPUT_EIR_CODE_LABEL},
+    {"pin", IDS_LIBADDRESSINPUT_PIN_CODE_LABEL},
+    {"postal", IDS_LIBADDRESSINPUT_POSTAL_CODE_LABEL},
+    {"zip", IDS_LIBADDRESSINPUT_ZIP_CODE_LABEL},
 };
 
-const NameIdMap kPostalCodeMessageIds = {
-  kPostalCodeInfoArray,
-  size(kPostalCodeInfoArray),
+const NameIdMap kPostalCodeMessageIds{
+    kPostalCodeInfoArray,
+    size(kPostalCodeInfoArray)
 };
 
 const NameIdInfo kLocalityInfoArray[] = {
-  {"city", IDS_LIBADDRESSINPUT_LOCALITY_LABEL},
-  {"district", IDS_LIBADDRESSINPUT_DISTRICT},
-  {"post_town", IDS_LIBADDRESSINPUT_POST_TOWN},
-  {"suburb", IDS_LIBADDRESSINPUT_SUBURB},
+    {"city", IDS_LIBADDRESSINPUT_LOCALITY_LABEL},
+    {"district", IDS_LIBADDRESSINPUT_DISTRICT},
+    {"post_town", IDS_LIBADDRESSINPUT_POST_TOWN},
+    {"suburb", IDS_LIBADDRESSINPUT_SUBURB},
 };
 
-const NameIdMap kLocalityMessageIds = {
-  kLocalityInfoArray,
-  size(kLocalityInfoArray),
+const NameIdMap kLocalityMessageIds{
+    kLocalityInfoArray,
+    size(kLocalityInfoArray)
 };
 
 const NameIdInfo kSublocalityInfoArray[] = {
-  {"district", IDS_LIBADDRESSINPUT_DISTRICT},
-  {"neighborhood", IDS_LIBADDRESSINPUT_NEIGHBORHOOD},
-  {"suburb", IDS_LIBADDRESSINPUT_SUBURB},
-  {"townland", IDS_LIBADDRESSINPUT_TOWNLAND},
-  {"village_township", IDS_LIBADDRESSINPUT_VILLAGE_TOWNSHIP},
+    {"district", IDS_LIBADDRESSINPUT_DISTRICT},
+    {"neighborhood", IDS_LIBADDRESSINPUT_NEIGHBORHOOD},
+    {"suburb", IDS_LIBADDRESSINPUT_SUBURB},
+    {"townland", IDS_LIBADDRESSINPUT_TOWNLAND},
+    {"village_township", IDS_LIBADDRESSINPUT_VILLAGE_TOWNSHIP},
 };
 
-const NameIdMap kSublocalityMessageIds = {
-  kSublocalityInfoArray,
-  size(kSublocalityInfoArray),
+const NameIdMap kSublocalityMessageIds{
+    kSublocalityInfoArray,
+    size(kSublocalityInfoArray)
 };
 
 #ifndef _NDEBUG
@@ -183,7 +182,7 @@
       postal_code_example_(),
       post_service_url_() {}
 
-Rule::~Rule() {}
+Rule::~Rule() = default;
 
 // static
 const Rule& Rule::GetDefault() {
@@ -234,7 +233,7 @@
 #ifndef _NDEBUG
   // Don't remove, see StaticMapChecker comments above.
   static StaticMapChecker map_checker;
-  #endif  // !_NDEBUG
+#endif  // !_NDEBUG
 
   std::string value;
   if (json.GetStringValueForKey("id", &value)) {
diff --git a/cpp/src/rule_retriever.cc b/cpp/src/rule_retriever.cc
index 52195c9..1324a45 100644
--- a/cpp/src/rule_retriever.cc
+++ b/cpp/src/rule_retriever.cc
@@ -43,7 +43,7 @@
   }
 
  private:
-  ~Helper() {}
+  ~Helper() = default;
 
   void OnDataRetrieved(bool success,
                        const std::string& key,
@@ -69,7 +69,7 @@
   assert(data_retriever_ != nullptr);
 }
 
-RuleRetriever::~RuleRetriever() {}
+RuleRetriever::~RuleRetriever() = default;
 
 void RuleRetriever::RetrieveRule(const std::string& key,
                                  const Callback& rule_ready) const {
diff --git a/cpp/src/rule_retriever.h b/cpp/src/rule_retriever.h
index b5096ba..a2d5e2c 100644
--- a/cpp/src/rule_retriever.h
+++ b/cpp/src/rule_retriever.h
@@ -36,8 +36,8 @@
 //    rules.RetrieveRule("data/CA/AB--fr", *rule_ready);
 class RuleRetriever {
  public:
-  typedef i18n::addressinput::Callback<const std::string&,
-                                       const Rule&> Callback;
+  using Callback =
+      i18n::addressinput::Callback<const std::string&, const Rule&>;
 
   RuleRetriever(const RuleRetriever&) = delete;
   RuleRetriever& operator=(const RuleRetriever&) = delete;
diff --git a/cpp/src/util/json.cc b/cpp/src/util/json.cc
index 9d04af5..56da5ee 100644
--- a/cpp/src/util/json.cc
+++ b/cpp/src/util/json.cc
@@ -45,9 +45,8 @@
   }
 
   ~JsonImpl() {
-    for (std::vector<const Json*>::const_iterator it = dictionaries_.begin();
-         it != dictionaries_.end(); ++it) {
-      delete *it;
+    for (auto ptr : dictionaries_) {
+      delete ptr;
     }
   }
 
@@ -73,8 +72,7 @@
       return false;
     }
 
-    value->assign(member->value.GetString(),
-                  member->value.GetStringLength());
+    value->assign(member->value.GetString(), member->value.GetStringLength());
     return true;
   }
 
@@ -105,7 +103,7 @@
 
 Json::Json() : impl_() {}
 
-Json::~Json() {}
+Json::~Json() = default;
 
 bool Json::ParseObject(const std::string& json) {
   assert(impl_ == nullptr);
diff --git a/cpp/src/util/re2ptr.h b/cpp/src/util/re2ptr.h
index e04bcfd..0ea80e7 100644
--- a/cpp/src/util/re2ptr.h
+++ b/cpp/src/util/re2ptr.h
@@ -27,13 +27,20 @@
 // class RE2.
 //
 // The work-around in this file works by wrapping pointers to RE2 object in the
-// simple struct RE2ptr, which is trivial to forward declare.
+// simple structs RE2PlainPtr and RE2ptr, which are trivial to forward declare.
 
 #include <re2/re2.h>
 
 namespace i18n {
 namespace addressinput {
 
+// A non-owner pointer to an RE2 instance. Since this is POD, it can be
+// initialized statically to NULL without a C++ static constructor.
+struct RE2PlainPtr {
+    RE2* ptr;
+};
+
+// This is an owning pointer to an RE2 instance.
 struct RE2ptr {
   RE2ptr(RE2* init_ptr) : ptr(init_ptr) {}
   ~RE2ptr() { delete ptr; }
diff --git a/cpp/src/util/string_compare.cc b/cpp/src/util/string_compare.cc
index bda48b5..90fb41b 100644
--- a/cpp/src/util/string_compare.cc
+++ b/cpp/src/util/string_compare.cc
@@ -65,7 +65,7 @@
     options_.set_case_sensitive(false);
   }
 
-  ~Impl() {}
+  ~Impl() = default;
 
   bool NaturalEquals(const std::string& a, const std::string& b) const {
     RE2 matcher(b, options_);
@@ -85,7 +85,7 @@
 
 StringCompare::StringCompare() : impl_(new Impl) {}
 
-StringCompare::~StringCompare() {}
+StringCompare::~StringCompare() = default;
 
 bool StringCompare::NaturalEquals(const std::string& a,
                                   const std::string& b) const {
diff --git a/cpp/src/validating_storage.cc b/cpp/src/validating_storage.cc
index c338306..5a0e87e 100644
--- a/cpp/src/validating_storage.cc
+++ b/cpp/src/validating_storage.cc
@@ -47,7 +47,7 @@
   }
 
  private:
-  ~Helper() {}
+  ~Helper() = default;
 
   void OnWrappedDataReady(bool success,
                           const std::string& key,
@@ -81,7 +81,7 @@
   assert(wrapped_storage_ != nullptr);
 }
 
-ValidatingStorage::~ValidatingStorage() {}
+ValidatingStorage::~ValidatingStorage() = default;
 
 void ValidatingStorage::Put(const std::string& key, std::string* data) {
   assert(data != nullptr);
diff --git a/cpp/src/validation_task.cc b/cpp/src/validation_task.cc
index 9bdff45..b6f7811 100644
--- a/cpp/src/validation_task.cc
+++ b/cpp/src/validation_task.cc
@@ -26,8 +26,6 @@
 #include <cassert>
 #include <cstddef>
 #include <string>
-#include <utility>
-#include <vector>
 
 #include <re2/re2.h>
 
@@ -59,8 +57,7 @@
   assert(lookup_key_ != nullptr);
 }
 
-ValidationTask::~ValidationTask() {
-}
+ValidationTask::~ValidationTask() = default;
 
 void ValidationTask::Run(Supplier* supplier) const {
   assert(supplier != nullptr);
@@ -103,19 +100,18 @@
 void ValidationTask::CheckUnexpectedField(
     const std::string& region_code) const {
   static const AddressField kFields[] = {
-    // COUNTRY is never unexpected.
-    ADMIN_AREA,
-    LOCALITY,
-    DEPENDENT_LOCALITY,
-    SORTING_CODE,
-    POSTAL_CODE,
-    STREET_ADDRESS,
-    ORGANIZATION,
-    RECIPIENT
+      // COUNTRY is never unexpected.
+      ADMIN_AREA,
+      LOCALITY,
+      DEPENDENT_LOCALITY,
+      SORTING_CODE,
+      POSTAL_CODE,
+      STREET_ADDRESS,
+      ORGANIZATION,
+      RECIPIENT,
   };
 
-  for (size_t i = 0; i < size(kFields); ++i) {
-    AddressField field = kFields[i];
+  for (AddressField field : kFields) {
     if (!address_.IsFieldEmpty(field) && !IsFieldUsed(field, region_code)) {
       ReportProblemMaybe(field, UNEXPECTED_FIELD);
     }
@@ -127,19 +123,18 @@
 void ValidationTask::CheckMissingRequiredField(
     const std::string& region_code) const {
   static const AddressField kFields[] = {
-    // COUNTRY is assumed to have already been checked.
-    ADMIN_AREA,
-    LOCALITY,
-    DEPENDENT_LOCALITY,
-    SORTING_CODE,
-    POSTAL_CODE,
-    STREET_ADDRESS
-    // ORGANIZATION is never required.
-    // RECIPIENT is handled separately.
+      // COUNTRY is assumed to have already been checked.
+      ADMIN_AREA,
+      LOCALITY,
+      DEPENDENT_LOCALITY,
+      SORTING_CODE,
+      POSTAL_CODE,
+      STREET_ADDRESS,
+      // ORGANIZATION is never required.
+      // RECIPIENT is handled separately.
   };
 
-  for (size_t i = 0; i < size(kFields); ++i) {
-    AddressField field = kFields[i];
+  for (AddressField field : kFields) {
     if (address_.IsFieldEmpty(field) && IsFieldRequired(field, region_code)) {
       ReportProblemMaybe(field, MISSING_REQUIRED_FIELD);
     }
@@ -200,8 +195,7 @@
     return;
   }
 
-  for (size_t depth = size(LookupKey::kHierarchy) - 1;
-       depth > 0; --depth) {
+  for (size_t depth = size(LookupKey::kHierarchy) - 1; depth > 0; --depth) {
     if (hierarchy.rule[depth] != nullptr) {
       // Validate sub-region specific postal code format. A sub-region specifies
       // the regular expression for a prefix of the postal code.
@@ -227,15 +221,11 @@
     return;
   }
 
-  std::vector<const RE2ptr*> matchers =
-      PostBoxMatchers::GetMatchers(country_rule);
-  for (std::vector<std::string>::const_iterator
-       line = address_.address_line.begin();
-       line != address_.address_line.end(); ++line) {
-    for (std::vector<const RE2ptr*>::const_iterator
-         matcher = matchers.begin();
-         matcher != matchers.end(); ++matcher) {
-      if (RE2::PartialMatch(*line, *(*matcher)->ptr)) {
+  const auto& matchers = PostBoxMatchers::GetMatchers(country_rule);
+  for (const auto& line : address_.address_line) {
+    for (auto ptr : matchers) {
+      assert(ptr != nullptr);
+      if (RE2::PartialMatch(line, *ptr->ptr)) {
         ReportProblem(STREET_ADDRESS, USES_P_O_BOX);
         return;
       }
@@ -245,7 +235,7 @@
 
 void ValidationTask::ReportProblem(AddressField field,
                                    AddressProblem problem) const {
-  problems_->insert(std::make_pair(field, problem));
+  problems_->emplace(field, problem);
 }
 
 void ValidationTask::ReportProblemMaybe(AddressField field,
diff --git a/cpp/test/address_data_test.cc b/cpp/test/address_data_test.cc
index dd20e2c..7373399 100644
--- a/cpp/test/address_data_test.cc
+++ b/cpp/test/address_data_test.cc
@@ -66,8 +66,8 @@
 
 TEST(AddressDataTest, GetRepeatedFieldValue) {
   AddressData address;
-  address.address_line.push_back("aaa");
-  address.address_line.push_back("222");
+  address.address_line.emplace_back("aaa");
+  address.address_line.emplace_back("222");
   EXPECT_EQ(address.address_line,
             address.GetRepeatedFieldValue(STREET_ADDRESS));
 }
@@ -91,7 +91,7 @@
   address.dependent_locality = "ddd";
   address.sorting_code = "xxx";
   address.postal_code = "zzz";
-  address.address_line.push_back("aaa");
+  address.address_line.emplace_back("aaa");
   address.organization = "ooo";
   address.recipient = "nnn";
 
@@ -119,35 +119,35 @@
 TEST(AddressDataTest, IsFieldEmptyVector) {
   AddressData address;
   EXPECT_TRUE(address.IsFieldEmpty(STREET_ADDRESS));
-  address.address_line.push_back("");
+  address.address_line.emplace_back("");
   EXPECT_TRUE(address.IsFieldEmpty(STREET_ADDRESS));
-  address.address_line.push_back("aaa");
+  address.address_line.emplace_back("aaa");
   EXPECT_FALSE(address.IsFieldEmpty(STREET_ADDRESS));
-  address.address_line.push_back("");
+  address.address_line.emplace_back("");
   EXPECT_FALSE(address.IsFieldEmpty(STREET_ADDRESS));
 }
 
 TEST(AddressDataTest, IsFieldEmptyVectorWhitespace) {
   AddressData address;
-  address.address_line.push_back("   ");
-  address.address_line.push_back("   ");
-  address.address_line.push_back("   ");
+  address.address_line.emplace_back("   ");
+  address.address_line.emplace_back("   ");
+  address.address_line.emplace_back("   ");
   EXPECT_TRUE(address.IsFieldEmpty(STREET_ADDRESS));
   address.address_line.clear();
-  address.address_line.push_back("abc");
+  address.address_line.emplace_back("abc");
   EXPECT_FALSE(address.IsFieldEmpty(STREET_ADDRESS));
   address.address_line.clear();
-  address.address_line.push_back("   ");
-  address.address_line.push_back(" b ");
-  address.address_line.push_back("   ");
+  address.address_line.emplace_back("   ");
+  address.address_line.emplace_back(" b ");
+  address.address_line.emplace_back("   ");
   EXPECT_FALSE(address.IsFieldEmpty(STREET_ADDRESS));
 }
 
 TEST(AddressDataTest, StreamFunction) {
   std::ostringstream oss;
   AddressData address;
-  address.address_line.push_back("Line 1");
-  address.address_line.push_back("Line 2");
+  address.address_line.emplace_back("Line 1");
+  address.address_line.emplace_back("Line 2");
   address.recipient = "N";
   address.region_code = "R";
   address.postal_code = "Z";
@@ -173,8 +173,8 @@
 
 TEST(AddressDataTest, TestEquals) {
   AddressData address;
-  address.address_line.push_back("Line 1");
-  address.address_line.push_back("Line 2");
+  address.address_line.emplace_back("Line 1");
+  address.address_line.emplace_back("Line 2");
   address.recipient = "N";
   address.region_code = "R";
   address.postal_code = "Z";
@@ -207,7 +207,7 @@
 }
 
 TEST(AddressDataTest, IsFieldEmptyInvalid) {
-  static const AddressField invalid_field = static_cast<AddressField>(-1);
+  static const auto invalid_field = static_cast<AddressField>(-1);
   AddressData address;
   ASSERT_DEATH_IF_SUPPORTED(address.IsFieldEmpty(invalid_field),
                             "ssertion.*failed");
diff --git a/cpp/test/address_field_util_test.cc b/cpp/test/address_field_util_test.cc
index f545df4..7370da1 100644
--- a/cpp/test/address_field_util_test.cc
+++ b/cpp/test/address_field_util_test.cc
@@ -41,18 +41,18 @@
   ParseFormatRule(u8"%O%n%N%n%A%nAX-%Z %C%nÅLAND", &actual);
 
   std::vector<FormatElement> expected;
-  expected.push_back(FormatElement(ORGANIZATION));
-  expected.push_back(FormatElement());
-  expected.push_back(FormatElement(RECIPIENT));
-  expected.push_back(FormatElement());
-  expected.push_back(FormatElement(STREET_ADDRESS));
-  expected.push_back(FormatElement());
-  expected.push_back(FormatElement("AX-"));
-  expected.push_back(FormatElement(POSTAL_CODE));
-  expected.push_back(FormatElement(" "));
-  expected.push_back(FormatElement(LOCALITY));
-  expected.push_back(FormatElement());
-  expected.push_back(FormatElement(u8"ÅLAND"));
+  expected.emplace_back(ORGANIZATION);
+  expected.emplace_back();
+  expected.emplace_back(RECIPIENT);
+  expected.emplace_back();
+  expected.emplace_back(STREET_ADDRESS);
+  expected.emplace_back();
+  expected.emplace_back("AX-");
+  expected.emplace_back(POSTAL_CODE);
+  expected.emplace_back(" ");
+  expected.emplace_back(LOCALITY);
+  expected.emplace_back();
+  expected.emplace_back(u8"ÅLAND");
 
   EXPECT_EQ(expected, actual);
 }
@@ -60,7 +60,7 @@
 TEST(AddressFieldUtilTest, FormatUnknownTokenIsIgnored) {
   std::vector<FormatElement> actual;
   ParseFormatRule("%1%R", &actual);  // %1 is not supported.
-  std::vector<FormatElement> expected(1, FormatElement(COUNTRY));
+  std::vector<FormatElement> expected{FormatElement(COUNTRY)};
   EXPECT_EQ(expected, actual);
 }
 
diff --git a/cpp/test/address_formatter_test.cc b/cpp/test/address_formatter_test.cc
index b46b3ec..7f62952 100644
--- a/cpp/test/address_formatter_test.cc
+++ b/cpp/test/address_formatter_test.cc
@@ -38,7 +38,7 @@
 TEST(AddressFormatterTest, GetStreetAddressLinesAsSingleLine_1Line) {
   AddressData address;
   address.region_code = "US";  // Not used.
-  address.address_line.push_back("Line 1");
+  address.address_line.emplace_back("Line 1");
 
   std::string result;
   GetStreetAddressLinesAsSingleLine(address, &result);
@@ -57,8 +57,8 @@
 TEST(AddressFormatterTest, GetStreetAddressLinesAsSingleLine_2Lines) {
   AddressData address;
   address.region_code = "US";  // Not used.
-  address.address_line.push_back("Line 1");
-  address.address_line.push_back("Line 2");
+  address.address_line.emplace_back("Line 1");
+  address.address_line.emplace_back("Line 2");
 
   std::string result;
   GetStreetAddressLinesAsSingleLine(address, &result);
@@ -86,11 +86,11 @@
 TEST(AddressFormatterTest, GetStreetAddressLinesAsSingleLine_5Lines) {
   AddressData address;
   address.region_code = "US";  // Not used.
-  address.address_line.push_back("Line 1");
-  address.address_line.push_back("Line 2");
-  address.address_line.push_back("Line 3");
-  address.address_line.push_back("Line 4");
-  address.address_line.push_back("Line 5");
+  address.address_line.emplace_back("Line 1");
+  address.address_line.emplace_back("Line 2");
+  address.address_line.emplace_back("Line 3");
+  address.address_line.emplace_back("Line 4");
+  address.address_line.emplace_back("Line 5");
   address.language_code = "fr";
 
   std::string result;
@@ -101,15 +101,15 @@
 TEST(AddressFormatterTest, GetFormattedNationalAddressLocalLanguage) {
   AddressData address;
   address.region_code = "NZ";
-  address.address_line.push_back("Rotopapa");
-  address.address_line.push_back("Irwell 3RD");
+  address.address_line.emplace_back("Rotopapa");
+  address.address_line.emplace_back("Irwell 3RD");
   address.postal_code = "8704";
   address.locality = "Leeston";
 
   std::vector<std::string> expected;
-  expected.push_back("Rotopapa");
-  expected.push_back("Irwell 3RD");
-  expected.push_back("Leeston 8704");
+  expected.emplace_back("Rotopapa");
+  expected.emplace_back("Irwell 3RD");
+  expected.emplace_back("Leeston 8704");
 
   std::vector<std::string> lines;
   GetFormattedNationalAddress(address, &lines);
@@ -136,16 +136,16 @@
 
   AddressData address;
   address.region_code = "TW";
-  address.address_line.push_back(kTaiwanStreetLine);
+  address.address_line.emplace_back(kTaiwanStreetLine);
   address.postal_code = kPostalCode;
   address.locality = kTaiwanCity;
   address.administrative_area = kTaiwanAdmin;
   address.language_code = "zh-Hant";
 
   std::vector<std::string> expected;
-  expected.push_back(kPostalCode);
+  expected.emplace_back(kPostalCode);
   expected.push_back(std::string(kTaiwanAdmin).append(kTaiwanCity));
-  expected.push_back(kTaiwanStreetLine);
+  expected.emplace_back(kTaiwanStreetLine);
 
   std::vector<std::string> lines;
   GetFormattedNationalAddress(address, &lines);
@@ -154,22 +154,24 @@
   std::string one_line;
   GetFormattedNationalAddressLine(address, &one_line);
   // No separators expected for Chinese.
-  EXPECT_EQ(std::string(kPostalCode).append(kTaiwanAdmin).append(kTaiwanCity)
-            .append(kTaiwanStreetLine),
+  EXPECT_EQ(std::string(kPostalCode)
+                .append(kTaiwanAdmin)
+                .append(kTaiwanCity)
+                .append(kTaiwanStreetLine),
             one_line);
 
   // Changing to the Latin variant will change the output.
   AddressData latin_address;
   latin_address.region_code = "TW";
-  latin_address.address_line.push_back("No. 33, Section 3 Xinyi Rd");
+  latin_address.address_line.emplace_back("No. 33, Section 3 Xinyi Rd");
   latin_address.postal_code = kPostalCode;
   latin_address.locality = "Da-an District";
   latin_address.administrative_area = "Taipei City";
   latin_address.language_code = "zh-Latn";
 
   std::vector<std::string> expected_latin;
-  expected_latin.push_back("No. 33, Section 3 Xinyi Rd");
-  expected_latin.push_back("Da-an District, Taipei City 106");
+  expected_latin.emplace_back("No. 33, Section 3 Xinyi Rd");
+  expected_latin.emplace_back("Da-an District, Taipei City 106");
 
   lines.clear();
   GetFormattedNationalAddress(latin_address, &lines);
@@ -184,17 +186,17 @@
 TEST(AddressFormatterTest, GetFormattedNationalAddressMultilingualCountry) {
   AddressData address;
   address.region_code = "CA";
-  address.address_line.push_back("5 Rue du Tresor");
-  address.address_line.push_back("Apt. 4");
+  address.address_line.emplace_back("5 Rue du Tresor");
+  address.address_line.emplace_back("Apt. 4");
   address.administrative_area = "QC";
   address.postal_code = "G1R 123";
   address.locality = "Montmagny";
   address.language_code = "fr";
 
   std::vector<std::string> expected;
-  expected.push_back("5 Rue du Tresor");
-  expected.push_back("Apt. 4");
-  expected.push_back("Montmagny QC G1R 123");
+  expected.emplace_back("5 Rue du Tresor");
+  expected.emplace_back("Apt. 4");
+  expected.emplace_back("Montmagny QC G1R 123");
 
   std::vector<std::string> lines;
   GetFormattedNationalAddress(address, &lines);
@@ -204,12 +206,12 @@
 TEST(AddressFormatterTest, GetFormattedNationalAddress_InlineStreetAddress) {
   AddressData address;
   address.region_code = "CI";
-  address.address_line.push_back("32 Boulevard Carde");
+  address.address_line.emplace_back("32 Boulevard Carde");
   address.locality = "Abidjan";
   address.sorting_code = "64";
 
   std::vector<std::string> expected;
-  expected.push_back("64 32 Boulevard Carde Abidjan 64");
+  expected.emplace_back("64 32 Boulevard Carde Abidjan 64");
 
   std::vector<std::string> lines;
   GetFormattedNationalAddress(address, &lines);
@@ -226,7 +228,7 @@
   EXPECT_EQ(expected, lines);
 
   address.locality = "Zurich";
-  expected.push_back("Zurich");
+  expected.emplace_back("Zurich");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
@@ -251,7 +253,7 @@
   EXPECT_EQ(expected, lines);
 
   address.administrative_area = "CA";
-  expected.push_back("CA");
+  expected.emplace_back("CA");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
@@ -282,13 +284,13 @@
   AddressData address;
   address.region_code = "AX";
   std::vector<std::string> expected;
-  expected.push_back(u8"ÅLAND");
+  expected.emplace_back(u8"ÅLAND");
   std::vector<std::string> lines;
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
   address.locality = "City";
-  expected.insert(expected.begin(), "City");
+  expected.emplace(expected.begin(), "City");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
@@ -309,12 +311,12 @@
   EXPECT_EQ(expected, lines);
 
   address.postal_code = "123";
-  expected.push_back(u8"〒123");
+  expected.emplace_back(u8"〒123");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
   address.administrative_area = "Prefecture";
-  expected.push_back("Prefecture");
+  expected.emplace_back("Prefecture");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
@@ -334,11 +336,11 @@
   EXPECT_EQ(expected, lines);
 
   address.sorting_code = "123";
-  expected.push_back("123 123");
+  expected.emplace_back("123 123");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
 
-  address.address_line.push_back("456 Main St");
+  address.address_line.emplace_back("456 Main St");
   expected.back().assign("123 456 Main St 123");
   GetFormattedNationalAddress(address, &lines);
   EXPECT_EQ(expected, lines);
@@ -359,5 +361,4 @@
   EXPECT_EQ(expected, lines);
 }
 
-
 }  // namespace
diff --git a/cpp/test/address_input_helper_test.cc b/cpp/test/address_input_helper_test.cc
index 13723ec..f0391d1 100644
--- a/cpp/test/address_input_helper_test.cc
+++ b/cpp/test/address_input_helper_test.cc
@@ -21,7 +21,6 @@
 
 #include <memory>
 #include <string>
-#include <utility>
 
 #include <gtest/gtest.h>
 
@@ -86,7 +85,7 @@
   address.region_code = "US";
   address.postal_code = "58098";
   // Other data should be left alone.
-  address.address_line.push_back("10 High St");
+  address.address_line.emplace_back("10 High St");
 
   // North Dakota has post codes starting with 58.
   AddressData expected = address;
@@ -290,7 +289,7 @@
        PostalCodeSharedAcrossDifferentHierarchies) {
   // Note that this data is in the format of data that would be returned from
   // the aggregate server.
-  source_->data_.insert(std::make_pair(
+  source_->data_.emplace(
       // We use KR since we need a country where we format all fields down to
       // dependent locality, or the hierarchy won't be loaded.
       "data/KR",
@@ -305,7 +304,7 @@
       R"("data/KR/B": )"
       R"({"id":"data/KR/B", "sub_keys":"B1"}, )"
       R"("data/KR/B/B1": )"
-      R"({"id":"data/KR/B/B1", "zip":"12"}})"));
+      R"({"id":"data/KR/B/B1", "zip":"12"}})");
 
   AddressData address;
   address.region_code = "KR";
@@ -324,7 +323,7 @@
   // Create data where one state matches the ZIP code, but the other doesn't:
   // within the state which does, multiple cities and sub-cities match. The only
   // thing we can be certain of is therefore the state.
-  source_->data_.insert(std::make_pair(
+  source_->data_.emplace(
       // We use KR since we need a country where we format all fields down to
       // dependent locality, or the hierarchy won't be loaded.
       "data/KR",
@@ -346,7 +345,7 @@
       R"({"id":"data/KR/A/A2/A2a", "zip":"123"}, )"
       // This key, in state B, does not match the ZIP code.
       R"("data/KR/B": )"
-      R"({"id":"data/KR/B", "zip":"2"}})"));
+      R"({"id":"data/KR/B", "zip":"2"}})");
 
   AddressData address;
   address.region_code = "KR";
diff --git a/cpp/test/address_ui_test.cc b/cpp/test/address_ui_test.cc
index 1f7d080..d4a9ac8 100644
--- a/cpp/test/address_ui_test.cc
+++ b/cpp/test/address_ui_test.cc
@@ -39,7 +39,7 @@
 using i18n::addressinput::ORGANIZATION;
 using i18n::addressinput::RECIPIENT;
 
-static const char kUiLanguageTag[] = "en";
+const char kUiLanguageTag[] = "en";
 
 // Returns testing::AssertionSuccess if the |components| are valid. Uses
 // |region_code| in test failure messages.
@@ -49,20 +49,18 @@
     return testing::AssertionFailure() << "no components";
   }
 
-  for (std::vector<AddressUiComponent>::const_iterator
-       component_it = components.begin();
-       component_it != components.end(); ++component_it) {
+  for (const auto& component : components) {
     static const AddressField kMinAddressField = COUNTRY;
     static const AddressField kMaxAddressField = RECIPIENT;
-    if (component_it->field < kMinAddressField ||
-        component_it->field > kMaxAddressField) {
-      return testing::AssertionFailure() << "unexpected field "
-                                         << component_it->field;
+    if (component.field < kMinAddressField ||
+        component.field > kMaxAddressField) {
+      return testing::AssertionFailure()
+             << "unexpected field " << component.field;
     }
 
-    if (component_it->name.empty()) {
-      return testing::AssertionFailure() << "empty field name for field "
-                                         << component_it->field;
+    if (component.name.empty()) {
+      return testing::AssertionFailure()
+             << "empty field name for field " << component.field;
     }
   }
 
@@ -76,7 +74,7 @@
   AddressUiTest& operator=(const AddressUiTest&) = delete;
 
  protected:
-  AddressUiTest() {}
+  AddressUiTest() = default;
   Localization localization_;
   std::string best_address_language_tag_;
 };
@@ -99,9 +97,8 @@
   const std::vector<AddressUiComponent>& components =
       BuildComponents(GetParam(), localization_, kUiLanguageTag,
                       &best_address_language_tag_);
-  for (std::vector<AddressUiComponent>::const_iterator it = components.begin();
-       it != components.end(); ++it) {
-    EXPECT_TRUE(fields.insert(it->field).second);
+  for (const auto& component : components) {
+    EXPECT_TRUE(fields.insert(component.field).second);
   }
 }
 
@@ -130,7 +127,7 @@
         expected_best_address_language_tag(expected_best_address_language_tag),
         expected_first_field(expected_first_field) {}
 
-  ~LanguageTestCase() {}
+  ~LanguageTestCase() = default;
 
   // The CLDR region code to test.
   const std::string region_code;
@@ -154,7 +151,7 @@
       delete;
 
  protected:
-  BestAddressLanguageTagTest() {}
+  BestAddressLanguageTagTest() = default;
   Localization localization_;
   std::string best_address_language_tag_;
 };
diff --git a/cpp/test/address_validator_test.cc b/cpp/test/address_validator_test.cc
index b19b6e4..e7660bf 100644
--- a/cpp/test/address_validator_test.cc
+++ b/cpp/test/address_validator_test.cc
@@ -24,7 +24,6 @@
 
 #include <memory>
 #include <string>
-#include <utility>
 
 #include <gtest/gtest.h>
 
@@ -55,7 +54,7 @@
 
 class ValidatorWrapper {
  public:
-  virtual ~ValidatorWrapper() {}
+  virtual ~ValidatorWrapper() = default;
   virtual void Validate(const AddressData& address,
                         bool allow_postal,
                         bool require_name,
@@ -189,7 +188,7 @@
                         testing::Values(&PreloadValidatorWrapper::Build));
 
 TEST_P(AddressValidatorTest, EmptyAddress) {
-  expected_.insert(std::make_pair(COUNTRY, MISSING_REQUIRED_FIELD));
+  expected_.emplace(COUNTRY, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -199,7 +198,7 @@
 TEST_P(AddressValidatorTest, InvalidCountry) {
   address_.region_code = "QZ";
 
-  expected_.insert(std::make_pair(COUNTRY, UNKNOWN_VALUE));
+  expected_.emplace(COUNTRY, UNKNOWN_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -211,7 +210,7 @@
   address_.administrative_area = "CA";  // California
   address_.locality = "Mountain View";
   address_.postal_code = "94043";
-  address_.address_line.push_back("1600 Amphitheatre Parkway");
+  address_.address_line.emplace_back("1600 Amphitheatre Parkway");
   address_.language_code = "en";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -223,10 +222,10 @@
   address_.region_code = "US";
   address_.postal_code = "123";
 
-  expected_.insert(std::make_pair(ADMIN_AREA, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  expected_.emplace(ADMIN_AREA, MISSING_REQUIRED_FIELD);
+  expected_.emplace(LOCALITY, MISSING_REQUIRED_FIELD);
+  expected_.emplace(STREET_ADDRESS, MISSING_REQUIRED_FIELD);
+  expected_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -237,7 +236,7 @@
   address_.region_code = "CH";
   address_.locality = "ZH";  // Zürich
   address_.postal_code = "8002";
-  address_.address_line.push_back("Brandschenkestrasse 110");
+  address_.address_line.emplace_back("Brandschenkestrasse 110");
   address_.language_code = "de";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -249,9 +248,9 @@
   address_.region_code = "CH";
   address_.postal_code = "123";
 
-  expected_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
-  expected_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
+  expected_.emplace(STREET_ADDRESS, MISSING_REQUIRED_FIELD);
+  expected_.emplace(POSTAL_CODE, INVALID_FORMAT);
+  expected_.emplace(LOCALITY, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -263,7 +262,7 @@
   address_.locality = "Villahermosa";
   address_.administrative_area = "TAB";  // Tabasco
   address_.postal_code = "86070";
-  address_.address_line.push_back(u8"Av Gregorio Méndez Magaña 1400");
+  address_.address_line.emplace_back(u8"Av Gregorio Méndez Magaña 1400");
   address_.language_code = "es";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -276,10 +275,10 @@
   address_.locality = "Villahermosa";
   address_.administrative_area = "TAB";  // Tabasco
   address_.postal_code = "80000";
-  address_.address_line.push_back(u8"Av Gregorio Méndez Magaña 1400");
+  address_.address_line.emplace_back(u8"Av Gregorio Méndez Magaña 1400");
   address_.language_code = "es";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, MISMATCHING_VALUE));
+  expected_.emplace(POSTAL_CODE, MISMATCHING_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -290,9 +289,9 @@
   address_.region_code = "CH";
   address_.postal_code = "123";
 
-  filter_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  filter_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
-  expected_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  expected_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -303,14 +302,14 @@
   address_.region_code = "CH";
   address_.locality = "ZH";  // Zürich
   address_.postal_code = "123";
-  address_.address_line.push_back("Brandschenkestrasse 110");
+  address_.address_line.emplace_back("Brandschenkestrasse 110");
   address_.language_code = "de";
 
-  problems_.insert(std::make_pair(LOCALITY, UNEXPECTED_FIELD));
-  problems_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
-  problems_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
+  problems_.emplace(LOCALITY, UNEXPECTED_FIELD);
+  problems_.emplace(LOCALITY, MISSING_REQUIRED_FIELD);
+  problems_.emplace(STREET_ADDRESS, MISSING_REQUIRED_FIELD);
 
-  expected_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  expected_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -320,9 +319,8 @@
 TEST_P(AddressValidatorTest, ValidKanjiAddressJP) {
   address_.region_code = "JP";
   address_.administrative_area = u8"徳島県";
-  address_.locality = u8"徳島市";
   address_.postal_code = "770-0847";
-  address_.address_line.push_back("...");
+  address_.address_line.emplace_back(u8"徳島市...");
   address_.language_code = "ja";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -337,9 +335,8 @@
 
   address_.region_code = "JP";
   address_.administrative_area = "Tokushima";
-  address_.locality = "Tokushima";
   address_.postal_code = "770-0847";
-  address_.address_line.push_back("...");
+  address_.address_line.emplace_back("...Tokushima");
   address_.language_code = "ja-Latn";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -356,7 +353,7 @@
   address_.administrative_area = u8"São Paulo";
   address_.locality = "Presidente Prudente";
   address_.postal_code = "19063-008";
-  address_.address_line.push_back("Rodovia Raposo Tavares, 6388-6682");
+  address_.address_line.emplace_back("Rodovia Raposo Tavares, 6388-6682");
   address_.language_code = "pt";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -373,7 +370,7 @@
   address_.administrative_area = "New Brunswick";
   address_.locality = "Saint John County";
   address_.postal_code = "E2L 4Z6";
-  address_.address_line.push_back("...");
+  address_.address_line.emplace_back("...");
   address_.language_code = "en";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
@@ -390,7 +387,7 @@
   address_.administrative_area = "Nouveau-Brunswick";
   address_.locality = u8"Comté de Saint-Jean";
   address_.postal_code = "E2L 4Z6";
-  address_.address_line.push_back("...");
+  address_.address_line.emplace_back("...");
   address_.language_code = "fr";
 
   ASSERT_NO_FATAL_FAILURE(Validate());
diff --git a/cpp/test/fake_storage.cc b/cpp/test/fake_storage.cc
index 3c27fc9..4ba48ce 100644
--- a/cpp/test/fake_storage.cc
+++ b/cpp/test/fake_storage.cc
@@ -16,26 +16,22 @@
 
 #include <cassert>
 #include <cstddef>
-#include <map>
 #include <string>
-#include <utility>
 
 namespace i18n {
 namespace addressinput {
 
-FakeStorage::FakeStorage() {}
+FakeStorage::FakeStorage() = default;
 
 FakeStorage::~FakeStorage() {
-  for (std::map<std::string, std::string*>::const_iterator
-       it = data_.begin(); it != data_.end(); ++it) {
-    delete it->second;
+  for (const auto& pair : data_) {
+    delete pair.second;
   }
 }
 
 void FakeStorage::Put(const std::string& key, std::string* data) {
   assert(data != nullptr);
-  std::pair<std::map<std::string, std::string*>::iterator, bool> result =
-      data_.insert(std::make_pair(key, data));
+  auto result = data_.emplace(key, data);
   if (!result.second) {
     // Replace data in existing entry for this key.
     delete result.first->second;
@@ -45,7 +41,7 @@
 
 void FakeStorage::Get(const std::string& key,
                       const Callback& data_ready) const {
-  std::map<std::string, std::string*>::const_iterator data_it = data_.find(key);
+  auto data_it = data_.find(key);
   bool success = data_it != data_.end();
   data_ready(success, key,
              success ? new std::string(*data_it->second) : nullptr);
diff --git a/cpp/test/language_test.cc b/cpp/test/language_test.cc
index 7a17649..6326b42 100644
--- a/cpp/test/language_test.cc
+++ b/cpp/test/language_test.cc
@@ -32,7 +32,7 @@
         expected_base_language(expected_base_language),
         expected_has_latin_script(expected_has_latin_script) {}
 
-  ~LanguageTestCase() {}
+  ~LanguageTestCase() = default;
 
   const std::string input_language_tag;
   const std::string expected_language_tag;
@@ -46,7 +46,7 @@
   LanguageTest& operator=(const LanguageTest&) = delete;
 
  protected:
-  LanguageTest() {}
+  LanguageTest() = default;
 };
 
 TEST_P(LanguageTest, ExtractedDataIsCorrect) {
diff --git a/cpp/test/localization_test.cc b/cpp/test/localization_test.cc
index d9ab737..4e80a67 100644
--- a/cpp/test/localization_test.cc
+++ b/cpp/test/localization_test.cc
@@ -56,12 +56,12 @@
   LocalizationTest& operator=(const LocalizationTest&) = delete;
 
  protected:
-  LocalizationTest() {}
+  LocalizationTest() = default;
   Localization localization_;
 };
 
 // Verifies that a custom message getter can be used.
-static const char kValidMessage[] = "Data";
+const char kValidMessage[] = "Data";
 std::string GetValidMessage(int message_id) { return kValidMessage; }
 TEST_P(LocalizationTest, ValidStringGetterCanBeUsed) {
   localization_.SetGetter(&GetValidMessage);
@@ -186,20 +186,19 @@
   other_fields.push_back(STREET_ADDRESS);
   other_fields.push_back(ORGANIZATION);
   other_fields.push_back(RECIPIENT);
-  for (std::vector<AddressField>::iterator it = other_fields.begin();
-       it != other_fields.end(); it++) {
+  for (AddressField field : other_fields) {
     EXPECT_EQ("You can't leave this empty.",
               localization.GetErrorMessage(
-                  address, *it, MISSING_REQUIRED_FIELD, true, true));
+                  address, field, MISSING_REQUIRED_FIELD, true, true));
     EXPECT_EQ("You can't leave this empty.",
               localization.GetErrorMessage(
-                  address, *it, MISSING_REQUIRED_FIELD, true, false));
+                  address, field, MISSING_REQUIRED_FIELD, true, false));
     EXPECT_EQ("You can't leave this empty.",
               localization.GetErrorMessage(
-                  address, *it, MISSING_REQUIRED_FIELD, false, false));
+                  address, field, MISSING_REQUIRED_FIELD, false, false));
     EXPECT_EQ("You can't leave this empty.",
               localization.GetErrorMessage(
-                  address, *it, MISSING_REQUIRED_FIELD, false, true));
+                  address, field, MISSING_REQUIRED_FIELD, false, true));
   }
 }
 
@@ -212,8 +211,8 @@
   address.dependent_locality = "bad dependent locality";
   address.sorting_code = "bad sorting code";
   std::vector<std::string> address_line;
-  address_line.push_back("bad address line 1");
-  address_line.push_back("bad address line 2");
+  address_line.emplace_back("bad address line 1");
+  address_line.emplace_back("bad address line 2");
   address.address_line = address_line;
   address.organization = "bad organization";
   address.recipient = "bad recipient";
@@ -462,28 +461,27 @@
   other_fields.push_back(STREET_ADDRESS);
   other_fields.push_back(ORGANIZATION);
   other_fields.push_back(RECIPIENT);
-  for (std::vector<AddressField>::iterator it = other_fields.begin();
-       it != other_fields.end(); it++) {
+  for (AddressField field : other_fields) {
     EXPECT_EQ("This address line appears to contain a post "
               "office box. Please use a street"
               " or building address.",
               localization.GetErrorMessage(
-                  address, *it, USES_P_O_BOX, true, true));
+                  address, field, USES_P_O_BOX, true, true));
     EXPECT_EQ("This address line appears to contain a post "
               "office box. Please use a street"
               " or building address.",
               localization.GetErrorMessage(
-                  address, *it, USES_P_O_BOX, true, false));
+                  address, field, USES_P_O_BOX, true, false));
     EXPECT_EQ("This address line appears to contain a post "
               "office box. Please use a street"
               " or building address.",
               localization.GetErrorMessage(
-                  address, *it, USES_P_O_BOX, false, false));
+                  address, field, USES_P_O_BOX, false, false));
     EXPECT_EQ("This address line appears to contain a post "
               "office box. Please use a street"
               " or building address.",
               localization.GetErrorMessage(
-                  address, *it, USES_P_O_BOX, false, true));
+                  address, field, USES_P_O_BOX, false, true));
   }
 }
 
diff --git a/cpp/test/mock_source.cc b/cpp/test/mock_source.cc
index fc2e59d..0d25375 100644
--- a/cpp/test/mock_source.cc
+++ b/cpp/test/mock_source.cc
@@ -15,18 +15,16 @@
 #include "mock_source.h"
 
 #include <cstddef>
-#include <map>
 #include <string>
 
 namespace i18n {
 namespace addressinput {
 
-MockSource::MockSource() {}
-
-MockSource::~MockSource() {}
+MockSource::MockSource() = default;
+MockSource::~MockSource() = default;
 
 void MockSource::Get(const std::string& key, const Callback& data_ready) const {
-  std::map<std::string, std::string>::const_iterator it = data_.find(key);
+  auto it = data_.find(key);
   bool success = it != data_.end();
   data_ready(success, key, success ? new std::string(it->second) : nullptr);
 }
diff --git a/cpp/test/mock_source.h b/cpp/test/mock_source.h
index ed503f9..e7b986a 100644
--- a/cpp/test/mock_source.h
+++ b/cpp/test/mock_source.h
@@ -33,8 +33,7 @@
 //
 //      MyClass() : source_(),
 //                  data_ready_(BuildCallback(this, &MyClass::OnDataReady)) {
-//        source_.data_.insert(
-//            std::make_pair("data/XA", "{\"id\":\"data/XA\"}"));
+//        source_.data_.emplace("data/XA", R"({"id":"data/XA"})");
 //      }
 //
 //      ~MyClass() {}
diff --git a/cpp/test/ondemand_supply_task_test.cc b/cpp/test/ondemand_supply_task_test.cc
index d510960..fd17860 100644
--- a/cpp/test/ondemand_supply_task_test.cc
+++ b/cpp/test/ondemand_supply_task_test.cc
@@ -23,7 +23,6 @@
 #include <map>
 #include <memory>
 #include <string>
-#include <utility>
 
 #include <gtest/gtest.h>
 
@@ -62,9 +61,8 @@
         task_(new OndemandSupplyTask(lookup_key_, &rule_cache_, *supplied_)) {}
 
   ~OndemandSupplyTaskTest() override {
-    for (std::map<std::string, const Rule*>::const_iterator
-         it = rule_cache_.begin(); it != rule_cache_.end(); ++it) {
-      delete it->second;
+    for (const auto& pair : rule_cache_) {
+      delete pair.second;
     }
   }
 
@@ -114,7 +112,7 @@
 }
 
 TEST_F(OndemandSupplyTaskTest, Valid) {
-  source_->data_.insert(std::make_pair("data/XA", R"({"id":"data/XA"})"));
+  source_->data_.emplace("data/XA", R"({"id":"data/XA"})");
 
   Queue("data/XA");
 
@@ -134,14 +132,10 @@
 }
 
 TEST_F(OndemandSupplyTaskTest, ValidHierarchy) {
-  source_->data_.insert(
-      std::make_pair("data/XA", R"({"id":"data/XA"})"));
-  source_->data_.insert(
-      std::make_pair("data/XA/aa", R"({"id":"data/XA/aa"})"));
-  source_->data_.insert(
-      std::make_pair("data/XA/aa/bb", R"({"id":"data/XA/aa/bb"})"));
-  source_->data_.insert(
-      std::make_pair("data/XA/aa/bb/cc", R"({"id":"data/XA/aa/bb/cc"})"));
+  source_->data_.emplace("data/XA", R"({"id":"data/XA"})");
+  source_->data_.emplace("data/XA/aa", R"({"id":"data/XA/aa"})");
+  source_->data_.emplace("data/XA/aa/bb", R"({"id":"data/XA/aa/bb"})");
+  source_->data_.emplace("data/XA/aa/bb/cc", R"({"id":"data/XA/aa/bb/cc"})");
 
   Queue("data/XA");
   Queue("data/XA/aa");
@@ -174,7 +168,7 @@
 }
 
 TEST_F(OndemandSupplyTaskTest, InvalidJson1) {
-  source_->data_.insert(std::make_pair("data/XA", ":"));
+  source_->data_.emplace("data/XA", ":");
 
   success_ = false;
 
@@ -185,8 +179,8 @@
 }
 
 TEST_F(OndemandSupplyTaskTest, InvalidJson2) {
-  source_->data_.insert(std::make_pair("data/XA", R"({"id":"data/XA"})"));
-  source_->data_.insert(std::make_pair("data/XA/aa", ":"));
+  source_->data_.emplace("data/XA", R"({"id":"data/XA"})");
+  source_->data_.emplace("data/XA/aa", ":");
 
   success_ = false;
 
@@ -198,8 +192,8 @@
 }
 
 TEST_F(OndemandSupplyTaskTest, EmptyJsonJustMeansServerKnowsNothingAboutKey) {
-  source_->data_.insert(std::make_pair("data/XA", R"({"id":"data/XA"})"));
-  source_->data_.insert(std::make_pair("data/XA/aa", "{}"));
+  source_->data_.emplace("data/XA", R"({"id":"data/XA"})");
+  source_->data_.emplace("data/XA/aa", "{}");
 
   Queue("data/XA");
   Queue("data/XA/aa");
@@ -215,7 +209,7 @@
 }
 
 TEST_F(OndemandSupplyTaskTest, IfCountryFailsAllFails) {
-  source_->data_.insert(std::make_pair("data/XA/aa", R"({"id":"data/XA/aa"})"));
+  source_->data_.emplace("data/XA/aa", R"({"id":"data/XA/aa"})");
 
   success_ = false;
 
diff --git a/cpp/test/post_box_matchers_test.cc b/cpp/test/post_box_matchers_test.cc
index 4ef7e1e..d076fe2 100644
--- a/cpp/test/post_box_matchers_test.cc
+++ b/cpp/test/post_box_matchers_test.cc
@@ -14,28 +14,18 @@
 
 #include "post_box_matchers.h"
 
-#include <cstddef>
-#include <vector>
-
 #include <gtest/gtest.h>
 
 #include "rule.h"
 
-namespace i18n {
-namespace addressinput {
-struct RE2ptr;
-}  // namespace addressinput
-}  // namespace i18n
-
 namespace {
 
 using i18n::addressinput::PostBoxMatchers;
-using i18n::addressinput::RE2ptr;
 using i18n::addressinput::Rule;
 
 TEST(PostBoxMatchersTest, AlwaysGetMatcherForLanguageUnd) {
   Rule rule;
-  std::vector<const RE2ptr*> matchers = PostBoxMatchers::GetMatchers(rule);
+  const auto& matchers = PostBoxMatchers::GetMatchers(rule);
   EXPECT_EQ(1, matchers.size());
   EXPECT_TRUE(matchers[0] != nullptr);
 }
@@ -43,7 +33,7 @@
 TEST(PostBoxMatchersTest, NoMatcherForInvalidLanguage) {
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"languages\":\"xx\"}"));
-  std::vector<const RE2ptr*> matchers = PostBoxMatchers::GetMatchers(rule);
+  const auto& matchers = PostBoxMatchers::GetMatchers(rule);
   EXPECT_EQ(1, matchers.size());
   EXPECT_TRUE(matchers[0] != nullptr);
 }
@@ -51,7 +41,7 @@
 TEST(PostBoxMatchersTest, HasMatcherForValidLanguage) {
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"languages\":\"sv\"}"));
-  std::vector<const RE2ptr*> matchers = PostBoxMatchers::GetMatchers(rule);
+  const auto& matchers = PostBoxMatchers::GetMatchers(rule);
   EXPECT_EQ(2, matchers.size());
   EXPECT_TRUE(matchers[0] != nullptr);
   EXPECT_TRUE(matchers[1] != nullptr);
@@ -60,7 +50,7 @@
 TEST(PostBoxMatchersTest, MixValidAndInvalidLanguage) {
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"languages\":\"xx~sv\"}"));
-  std::vector<const RE2ptr*> matchers = PostBoxMatchers::GetMatchers(rule);
+  const auto& matchers = PostBoxMatchers::GetMatchers(rule);
   EXPECT_EQ(2, matchers.size());
   EXPECT_TRUE(matchers[0] != nullptr);
   EXPECT_TRUE(matchers[1] != nullptr);
@@ -69,7 +59,7 @@
 TEST(PostBoxMatchersTest, UseBaseLanguageForMatching) {
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"languages\":\"sv-SE\"}"));
-  std::vector<const RE2ptr*> matchers = PostBoxMatchers::GetMatchers(rule);
+  const auto& matchers = PostBoxMatchers::GetMatchers(rule);
   EXPECT_EQ(2, matchers.size());
   EXPECT_TRUE(matchers[0] != nullptr);
   EXPECT_TRUE(matchers[1] != nullptr);
@@ -78,7 +68,7 @@
 TEST(PostBoxMatchersTest, LenientLanguageTagParsing) {
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"languages\":\"SV_SE\"}"));
-  std::vector<const RE2ptr*> matchers = PostBoxMatchers::GetMatchers(rule);
+  const auto& matchers = PostBoxMatchers::GetMatchers(rule);
   EXPECT_EQ(2, matchers.size());
   EXPECT_TRUE(matchers[0] != nullptr);
   EXPECT_TRUE(matchers[1] != nullptr);
diff --git a/cpp/test/preload_supplier_test.cc b/cpp/test/preload_supplier_test.cc
index 2d9402b..ab39cf9 100644
--- a/cpp/test/preload_supplier_test.cc
+++ b/cpp/test/preload_supplier_test.cc
@@ -143,8 +143,7 @@
 
 TEST_F(PreloadSupplierTest, GetRulesForRegion) {
   supplier_.LoadRules("CN", *loaded_callback_);
-  const std::map<std::string, const Rule*>& rules =
-      supplier_.GetRulesForRegion("CN");
+  const auto& rules = supplier_.GetRulesForRegion("CN");
   EXPECT_TRUE(rules.find("data/CN") != rules.end());
   EXPECT_LT(1U, rules.size());
 }
diff --git a/cpp/test/region_data_constants_test.cc b/cpp/test/region_data_constants_test.cc
index 9acaf8b..ff7595b 100644
--- a/cpp/test/region_data_constants_test.cc
+++ b/cpp/test/region_data_constants_test.cc
@@ -29,7 +29,7 @@
   RegionCodeTest& operator=(const RegionCodeTest&) = delete;
 
  protected:
-  RegionCodeTest() {}
+  RegionCodeTest() = default;
 };
 
 // Verifies that a region code consists of two characters, for example "ZA".
@@ -68,7 +68,7 @@
   RegionDataTest& operator=(const RegionDataTest&) = delete;
 
  protected:
-  RegionDataTest() {}
+  RegionDataTest() = default;
 
   const std::string& GetData() const {
     return RegionDataConstants::GetRegionData(GetParam());
diff --git a/cpp/test/retriever_test.cc b/cpp/test/retriever_test.cc
index a394e71..29a0a3d 100644
--- a/cpp/test/retriever_test.cc
+++ b/cpp/test/retriever_test.cc
@@ -130,7 +130,7 @@
   StaleStorage& operator=(const StaleStorage&) = delete;
 
   StaleStorage() : data_updated_(false) {}
-  ~StaleStorage() override {}
+  ~StaleStorage() override = default;
 
   // Storage implementation.
   void Get(const std::string& key, const Callback& data_ready) const override {
@@ -148,7 +148,7 @@
 
 TEST_F(RetrieverTest, UseStaleDataWhenSourceFails) {
   // Owned by |resilient_retriever|.
-  StaleStorage* stale_storage = new StaleStorage;
+  auto* stale_storage = new StaleStorage;
   // An empty MockSource will fail for any request.
   Retriever resilient_retriever(new MockSource, stale_storage);
 
@@ -162,7 +162,7 @@
 
 TEST_F(RetrieverTest, DoNotUseStaleDataWhenSourceSucceeds) {
   // Owned by |resilient_retriever|.
-  StaleStorage* stale_storage = new StaleStorage;
+  auto* stale_storage = new StaleStorage;
   Retriever resilient_retriever(new TestdataSource(false), stale_storage);
 
   resilient_retriever.Retrieve(kKey, *data_ready_);
diff --git a/cpp/test/rule_test.cc b/cpp/test/rule_test.cc
index 2c581a4..e0e3abb 100644
--- a/cpp/test/rule_test.cc
+++ b/cpp/test/rule_test.cc
@@ -148,8 +148,8 @@
 
 TEST(RuleTest, ParsesFormatCorrectly) {
   std::vector<FormatElement> expected;
-  expected.push_back(FormatElement(ADMIN_AREA));
-  expected.push_back(FormatElement(LOCALITY));
+  expected.emplace_back(ADMIN_AREA);
+  expected.emplace_back(LOCALITY);
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"fmt\":\"%S%C\"}"));
   EXPECT_EQ(expected, rule.GetFormat());
@@ -169,8 +169,8 @@
 
 TEST(RuleTest, ParsesLatinFormatCorrectly) {
   std::vector<FormatElement> expected;
-  expected.push_back(FormatElement(LOCALITY));
-  expected.push_back(FormatElement(ADMIN_AREA));
+  expected.emplace_back(LOCALITY);
+  expected.emplace_back(ADMIN_AREA);
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"lfmt\":\"%C%S\"}"));
   EXPECT_EQ(expected, rule.GetLatinFormat());
@@ -187,9 +187,9 @@
 
 TEST(RuleTest, ParsesSubKeysCorrectly) {
   std::vector<std::string> expected;
-  expected.push_back("aa");
-  expected.push_back("bb");
-  expected.push_back("cc");
+  expected.emplace_back("aa");
+  expected.emplace_back("bb");
+  expected.emplace_back("cc");
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"sub_keys\":\"aa~bb~cc\"}"));
   EXPECT_EQ(expected, rule.GetSubKeys());
@@ -197,9 +197,9 @@
 
 TEST(RuleTest, ParsesLanguagesCorrectly) {
   std::vector<std::string> expected;
-  expected.push_back("de");
-  expected.push_back("fr");
-  expected.push_back("it");
+  expected.emplace_back("de");
+  expected.emplace_back("fr");
+  expected.emplace_back("it");
   Rule rule;
   ASSERT_TRUE(rule.ParseSerializedRule("{\"languages\":\"de~fr~it\"}"));
   EXPECT_EQ(expected, rule.GetLanguages());
@@ -256,7 +256,7 @@
   PostalCodeNameParseTest& operator=(const PostalCodeNameParseTest&) = delete;
 
  protected:
-  PostalCodeNameParseTest() {}
+  PostalCodeNameParseTest() = default;
   Rule rule_;
 };
 
@@ -285,7 +285,7 @@
   LocalityNameParseTest& operator=(const LocalityNameParseTest&) = delete;
 
  protected:
-  LocalityNameParseTest() {}
+  LocalityNameParseTest() = default;
   Rule rule_;
 };
 
@@ -314,7 +314,7 @@
   SublocalityNameParseTest& operator=(const SublocalityNameParseTest&) = delete;
 
  protected:
-  SublocalityNameParseTest() {}
+  SublocalityNameParseTest() = default;
   Rule rule_;
 };
 
@@ -345,7 +345,7 @@
   AdminAreaNameParseTest& operator=(const AdminAreaNameParseTest&) = delete;
 
  protected:
-  AdminAreaNameParseTest() {}
+  AdminAreaNameParseTest() = default;
   Rule rule_;
 };
 
@@ -389,11 +389,11 @@
   RuleParseTest& operator=(const RuleParseTest&) = delete;
 
  protected:
-  RuleParseTest() {}
+  RuleParseTest() = default;
 
   const std::string& GetRegionData() const {
     // GetParam() is either a region code or the region data itself.
-    // RegionDataContants::GetRegionData() returns an empty string for anything
+    // RegionDataConstants::GetRegionData() returns an empty string for anything
     // that's not a region code.
     const std::string& data = RegionDataConstants::GetRegionData(GetParam());
     return !data.empty() ? data : GetParam();
diff --git a/cpp/test/supplier_test.cc b/cpp/test/supplier_test.cc
index 39f4355..4a97bd8 100644
--- a/cpp/test/supplier_test.cc
+++ b/cpp/test/supplier_test.cc
@@ -46,7 +46,7 @@
 
 class SupplierWrapper {
  public:
-  virtual ~SupplierWrapper() {}
+  virtual ~SupplierWrapper() = default;
   virtual void Supply(const LookupKey& lookup_key,
                       const Supplier::Callback& supplied) = 0;
 };
diff --git a/cpp/test/testdata_source.cc b/cpp/test/testdata_source.cc
index 9325c12..a7647e2 100644
--- a/cpp/test/testdata_source.cc
+++ b/cpp/test/testdata_source.cc
@@ -21,7 +21,6 @@
 #include <iostream>
 #include <map>
 #include <string>
-#include <utility>
 
 namespace i18n {
 namespace addressinput {
@@ -64,8 +63,8 @@
   std::string key;
   std::string value;
 
-  std::map<std::string, std::string>::iterator last_data_it = data.end();
-  std::map<std::string, std::string>::iterator aggregate_data_it = data.end();
+  auto last_data_it = data.end();
+  auto aggregate_data_it = data.end();
 
   while (file.good()) {
     // Example line from countryinfo.txt:
@@ -80,9 +79,8 @@
       std::getline(file, value, '\n');
 
       // For example, map '-data/CH/AG' to '{"name": "Aargau"}'.
-      last_data_it = data.insert(
-          last_data_it,
-          std::make_pair(normal_prefix + key, value));
+      last_data_it =
+          data.emplace_hint(last_data_it, normal_prefix + key, value);
 
       // Aggregate keys that begin with 'data/'. We don't aggregate keys that
       // begin with 'example/' because example data is not used anywhere.
@@ -125,9 +123,8 @@
 
           // Begin a new aggregate string, for example:
           //     {"data/CH/AG": {"name": "Aargau"}
-          aggregate_data_it = data.insert(
-              aggregate_data_it,
-              std::make_pair(aggregate_key, "{\"" + key + "\": " + value));
+          aggregate_data_it = data.emplace_hint(
+              aggregate_data_it, aggregate_key, "{\"" + key + "\": " + value);
         }
       }
     }
@@ -150,14 +147,13 @@
 TestdataSource::TestdataSource(bool aggregate)
     : aggregate_(aggregate), src_path_(kDataFileName) {}
 
-TestdataSource::~TestdataSource() {}
+TestdataSource::~TestdataSource() = default;
 
 void TestdataSource::Get(const std::string& key,
                          const Callback& data_ready) const {
   std::string prefixed_key(1, aggregate_ ? kAggregatePrefix : kNormalPrefix);
   prefixed_key += key;
-  std::map<std::string, std::string>::const_iterator data_it =
-      GetData(src_path_).find(prefixed_key);
+  auto data_it = GetData(src_path_).find(prefixed_key);
   bool success = data_it != GetData(src_path_).end();
   std::string* data = nullptr;
   if (success) {
diff --git a/cpp/test/testdata_source_test.cc b/cpp/test/testdata_source_test.cc
index 304d192..94b1eaa 100644
--- a/cpp/test/testdata_source_test.cc
+++ b/cpp/test/testdata_source_test.cc
@@ -28,10 +28,10 @@
 namespace {
 
 using i18n::addressinput::BuildCallback;
+using i18n::addressinput::kDataFileName;
 using i18n::addressinput::RegionDataConstants;
 using i18n::addressinput::Source;
 using i18n::addressinput::TestdataSource;
-using i18n::addressinput::kDataFileName;
 
 // Tests for TestdataSource object.
 class TestdataSourceTest : public testing::TestWithParam<std::string> {
@@ -81,8 +81,8 @@
 
   std::string expected_data_begin = R"({"id":")" + key + R"(")";
   if (data.compare(0, expected_data_begin.length(), expected_data_begin) != 0) {
-    return testing::AssertionFailure() << data << " does not begin with "
-                                       << expected_data_begin;
+    return testing::AssertionFailure()
+           << data << " does not begin with " << expected_data_begin;
   }
 
   // Verify that the data ends on "}.
@@ -92,8 +92,8 @@
                    kDataEndLength,
                    kDataEnd,
                    kDataEndLength) != 0) {
-    return testing::AssertionFailure() << data << " does not end with "
-                                       << kDataEnd;
+    return testing::AssertionFailure()
+           << data << " does not end with " << kDataEnd;
   }
 
   return testing::AssertionSuccess();
@@ -129,8 +129,8 @@
 
   std::string expected_data_begin = "{\"" + key;
   if (data.compare(0, expected_data_begin.length(), expected_data_begin) != 0) {
-    return testing::AssertionFailure() << data << " does not begin with "
-                                       << expected_data_begin;
+    return testing::AssertionFailure()
+           << data << " does not begin with " << expected_data_begin;
   }
 
   // Verify that the data ends on "}}.
@@ -140,8 +140,8 @@
                    kDataEndLength,
                    kDataEnd,
                    kDataEndLength) != 0) {
-    return testing::AssertionFailure() << data << " does not end with "
-                                       << kDataEnd;
+    return testing::AssertionFailure()
+           << data << " does not end with " << kDataEnd;
   }
 
   return testing::AssertionSuccess();
@@ -159,8 +159,7 @@
 
 // Verifies that TestdataSource gets valid aggregated data for a region code.
 TEST_P(TestdataSourceTest,
-    TestdataSourceWithPathHasValidAggregatedDataForRegion) {
-
+       TestdataSourceWithPathHasValidAggregatedDataForRegion) {
   std::string key = "data/" + GetParam();
   aggregate_source_with_path_.Get(key, *data_ready_);
 
diff --git a/cpp/test/util/json_test.cc b/cpp/test/util/json_test.cc
index 7ead26a..3105b02 100644
--- a/cpp/test/util/json_test.cc
+++ b/cpp/test/util/json_test.cc
@@ -15,7 +15,6 @@
 #include "util/json.h"
 
 #include <string>
-#include <vector>
 
 #include <gtest/gtest.h>
 
@@ -126,7 +125,7 @@
 TEST(JsonTest, DictionaryFound) {
   Json json;
   ASSERT_TRUE(json.ParseObject(R"({"key":{"inner_key":"value"}})"));
-  const std::vector<const Json*>& sub_dicts = json.GetSubDictionaries();
+  const auto& sub_dicts = json.GetSubDictionaries();
   ASSERT_EQ(1U, sub_dicts.size());
 
   std::string value;
@@ -138,11 +137,10 @@
   Json json;
   ASSERT_TRUE(json.ParseObject(
       R"({"key":{"inner_key":{"inner_inner_key":"value"}}})"));
-  const std::vector<const Json*>& sub_dicts = json.GetSubDictionaries();
+  const auto& sub_dicts = json.GetSubDictionaries();
   ASSERT_EQ(1U, sub_dicts.size());
 
-  const std::vector<const Json*>& sub_sub_dicts =
-      sub_dicts.front()->GetSubDictionaries();
+  const auto& sub_sub_dicts = sub_dicts.front()->GetSubDictionaries();
   ASSERT_EQ(1U, sub_sub_dicts.size());
 
   std::string value;
diff --git a/cpp/test/util/string_compare_test.cc b/cpp/test/util/string_compare_test.cc
index e2a636b..df02223 100644
--- a/cpp/test/util/string_compare_test.cc
+++ b/cpp/test/util/string_compare_test.cc
@@ -32,7 +32,7 @@
         should_be_equal(should_be_equal),
         should_be_less(should_be_less) {}
 
-  ~TestCase() {}
+  ~TestCase() = default;
 
   std::string left;
   std::string right;
@@ -46,7 +46,7 @@
   StringCompareTest& operator=(const StringCompareTest&) = delete;
 
  protected:
-  StringCompareTest() {}
+  StringCompareTest() = default;
   StringCompare compare_;
 };
 
diff --git a/cpp/test/util/string_util_test.cc b/cpp/test/util/string_util_test.cc
index e7de1fc..216bef3 100644
--- a/cpp/test/util/string_util_test.cc
+++ b/cpp/test/util/string_util_test.cc
@@ -25,19 +25,18 @@
 
 TEST(StringUtilTest, Ok) {
   std::vector<std::string> subst;
-  subst.push_back("A");
-  subst.push_back("B");
-  subst.push_back("C");
+  subst.emplace_back("A");
+  subst.emplace_back("B");
+  subst.emplace_back("C");
 
-  EXPECT_EQ("aA,bB,cC",
-            DoReplaceStringPlaceholders("a$1,b$2,c$3", subst));
+  EXPECT_EQ("aA,bB,cC", DoReplaceStringPlaceholders("a$1,b$2,c$3", subst));
 }
 
 TEST(StringUtilTest, FewParameters) {
   std::vector<std::string> subst;
-  subst.push_back("A");
-  subst.push_back("B");
-  subst.push_back("C");
+  subst.emplace_back("A");
+  subst.emplace_back("B");
+  subst.emplace_back("C");
 
   EXPECT_EQ("aA,bB,cC,d,aA",
             DoReplaceStringPlaceholders("a$1,b$2,c$3,d$4,a$1", subst));
@@ -45,28 +44,29 @@
 
 TEST(StringUtilTest, MoreThan9Parameters) {
   std::vector<std::string> subst;
-  subst.push_back("A");
-  subst.push_back("B");
-  subst.push_back("C");
-  subst.push_back("D");
-  subst.push_back("E");
-  subst.push_back("F");
-  subst.push_back("G");
-  subst.push_back("H");
-  subst.push_back("I");
-  subst.push_back("J");
-  subst.push_back("K");
+  subst.emplace_back("A");
+  subst.emplace_back("B");
+  subst.emplace_back("C");
+  subst.emplace_back("D");
+  subst.emplace_back("E");
+  subst.emplace_back("F");
+  subst.emplace_back("G");
+  subst.emplace_back("H");
+  subst.emplace_back("I");
+  subst.emplace_back("J");
+  subst.emplace_back("K");
 
   EXPECT_EQ("aA,bB,cC,dD,eE,fF,gG,hH,iI,jJ,kK,aA",
             DoReplaceStringPlaceholders("a$1,b$2,c$3,d$4,e$5,f$6,g$7,h$8,i$9,"
-                                        "j$10,k$11,a$1", subst));
+                                        "j$10,k$11,a$1",
+                                        subst));
 }
 
 TEST(StringUtilTest, ConsecutiveDollarSigns) {
   std::vector<std::string> subst;
-  subst.push_back("A");
-  subst.push_back("B");
-  subst.push_back("C");
+  subst.emplace_back("A");
+  subst.emplace_back("B");
+  subst.emplace_back("C");
 
   EXPECT_EQ("$1 $$2 $$$3",
             DoReplaceStringPlaceholders("$$1 $$$2 $$$$3", subst));
diff --git a/cpp/test/validation_task_test.cc b/cpp/test/validation_task_test.cc
index fdde7cc..0cbe236 100644
--- a/cpp/test/validation_task_test.cc
+++ b/cpp/test/validation_task_test.cc
@@ -23,7 +23,6 @@
 
 #include <cstddef>
 #include <memory>
-#include <utility>
 
 #include <gtest/gtest.h>
 
@@ -54,44 +53,42 @@
     // Add all problems to the filter except those affected by the metadata
     // in region_data_constants.cc.
     static const AddressField kFields[] = {
-      COUNTRY,
-      ADMIN_AREA,
-      LOCALITY,
-      DEPENDENT_LOCALITY,
-      SORTING_CODE,
-      POSTAL_CODE,
-      STREET_ADDRESS,
-      ORGANIZATION,
-      RECIPIENT
+        COUNTRY,
+        ADMIN_AREA,
+        LOCALITY,
+        DEPENDENT_LOCALITY,
+        SORTING_CODE,
+        POSTAL_CODE,
+        STREET_ADDRESS,
+        ORGANIZATION,
+        RECIPIENT,
     };
 
     static const AddressProblem kProblems[] = {
-      // UNEXPECTED_FIELD is validated using IsFieldUsed().
-      // MISSING_REQUIRED_FIELD is validated using IsFieldRequired().
-      UNKNOWN_VALUE,
-      INVALID_FORMAT,
-      MISMATCHING_VALUE,
-      USES_P_O_BOX
+        // UNEXPECTED_FIELD is validated using IsFieldUsed().
+        // MISSING_REQUIRED_FIELD is validated using IsFieldRequired().
+        UNKNOWN_VALUE,
+        INVALID_FORMAT,
+        MISMATCHING_VALUE,
+        USES_P_O_BOX,
     };
 
-    for (size_t i = 0; i < size(kFields); ++i) {
-      AddressField field = kFields[i];
-      for (size_t j = 0; j < size(kProblems); ++j) {
-        AddressProblem problem = kProblems[j];
-        filter_.insert(std::make_pair(field, problem));
+    for (AddressField field : kFields) {
+      for (AddressProblem problem : kProblems) {
+        filter_.emplace(field, problem);
       }
     }
 
-    filter_.insert(std::make_pair(COUNTRY, UNEXPECTED_FIELD));
-    filter_.insert(std::make_pair(COUNTRY, MISSING_REQUIRED_FIELD));
-    filter_.insert(std::make_pair(RECIPIENT, UNEXPECTED_FIELD));
-    filter_.insert(std::make_pair(RECIPIENT, MISSING_REQUIRED_FIELD));
+    filter_.emplace(COUNTRY, UNEXPECTED_FIELD);
+    filter_.emplace(COUNTRY, MISSING_REQUIRED_FIELD);
+    filter_.emplace(RECIPIENT, UNEXPECTED_FIELD);
+    filter_.emplace(RECIPIENT, MISSING_REQUIRED_FIELD);
   }
 
   void Validate() {
     Rule rule[size(LookupKey::kHierarchy)];
 
-    ValidationTask* task = new ValidationTask(
+    auto* task = new ValidationTask(
         address_,
         allow_postal_,
         require_name_,
@@ -153,7 +150,7 @@
 }
 
 TEST_F(ValidationTaskTest, SuccessCountryRuleNullNameEmpty) {
-  expected_.insert(std::make_pair(COUNTRY, MISSING_REQUIRED_FIELD));
+  expected_.emplace(COUNTRY, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -163,7 +160,7 @@
 TEST_F(ValidationTaskTest, SuccessCountryRuleNullNameNotEmpty) {
   address_.region_code = "rrr";
 
-  expected_.insert(std::make_pair(COUNTRY, UNKNOWN_VALUE));
+  expected_.emplace(COUNTRY, UNKNOWN_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -173,7 +170,7 @@
 TEST_F(ValidationTaskTest, SuccessCountryRuleEmptyNameEmpty) {
   json_[0] = "{}";
 
-  expected_.insert(std::make_pair(COUNTRY, MISSING_REQUIRED_FIELD));
+  expected_.emplace(COUNTRY, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -195,14 +192,14 @@
 
   address_.region_code = "US";
 
-  filter_.insert(std::make_pair(ADMIN_AREA, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(POSTAL_CODE, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(ADMIN_AREA, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(POSTAL_CODE, MISSING_REQUIRED_FIELD));
-  expected_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
+  filter_.emplace(ADMIN_AREA, MISSING_REQUIRED_FIELD);
+  filter_.emplace(LOCALITY, MISSING_REQUIRED_FIELD);
+  filter_.emplace(POSTAL_CODE, MISSING_REQUIRED_FIELD);
+  filter_.emplace(STREET_ADDRESS, MISSING_REQUIRED_FIELD);
+  expected_.emplace(ADMIN_AREA, MISSING_REQUIRED_FIELD);
+  expected_.emplace(LOCALITY, MISSING_REQUIRED_FIELD);
+  expected_.emplace(POSTAL_CODE, MISSING_REQUIRED_FIELD);
+  expected_.emplace(STREET_ADDRESS, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -216,15 +213,15 @@
   address_.administrative_area = "sss";
   address_.locality = "ccc";
   address_.postal_code = "zzz";
-  address_.address_line.push_back("aaa");
+  address_.address_line.emplace_back("aaa");
   address_.organization = "ooo";
   address_.recipient = "nnn";
 
-  filter_.insert(std::make_pair(ADMIN_AREA, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(POSTAL_CODE, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
-  filter_.insert(std::make_pair(ORGANIZATION, MISSING_REQUIRED_FIELD));
+  filter_.emplace(ADMIN_AREA, MISSING_REQUIRED_FIELD);
+  filter_.emplace(LOCALITY, MISSING_REQUIRED_FIELD);
+  filter_.emplace(POSTAL_CODE, MISSING_REQUIRED_FIELD);
+  filter_.emplace(STREET_ADDRESS, MISSING_REQUIRED_FIELD);
+  filter_.emplace(ORGANIZATION, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -237,8 +234,8 @@
   address_.region_code = "US";
   address_.dependent_locality = "ddd";
 
-  filter_.insert(std::make_pair(DEPENDENT_LOCALITY, UNEXPECTED_FIELD));
-  expected_.insert(std::make_pair(DEPENDENT_LOCALITY, UNEXPECTED_FIELD));
+  filter_.emplace(DEPENDENT_LOCALITY, UNEXPECTED_FIELD);
+  expected_.emplace(DEPENDENT_LOCALITY, UNEXPECTED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -252,7 +249,7 @@
 
   require_name_ = true;
 
-  expected_.insert(std::make_pair(RECIPIENT, MISSING_REQUIRED_FIELD));
+  expected_.emplace(RECIPIENT, MISSING_REQUIRED_FIELD);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -265,7 +262,7 @@
   address_.region_code = "rrr";
   address_.administrative_area = "sss";
 
-  expected_.insert(std::make_pair(ADMIN_AREA, UNKNOWN_VALUE));
+  expected_.emplace(ADMIN_AREA, UNKNOWN_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -290,7 +287,7 @@
   address_.region_code = "rrr";
   address_.postal_code = "12";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  expected_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -303,7 +300,7 @@
   address_.region_code = "rrr";
   address_.postal_code = "1234";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  expected_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -328,7 +325,7 @@
   address_.region_code = "rrr";
   address_.postal_code = "000";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, MISMATCHING_VALUE));
+  expected_.emplace(POSTAL_CODE, MISMATCHING_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -343,7 +340,7 @@
   address_.region_code = "rrr";
   address_.postal_code = "100";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, MISMATCHING_VALUE));
+  expected_.emplace(POSTAL_CODE, MISMATCHING_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -359,7 +356,7 @@
   address_.region_code = "rrr";
   address_.postal_code = "120";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, MISMATCHING_VALUE));
+  expected_.emplace(POSTAL_CODE, MISMATCHING_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -387,7 +384,7 @@
   address_.region_code = "rrr";
   address_.postal_code = "10960";
 
-  expected_.insert(std::make_pair(POSTAL_CODE, MISMATCHING_VALUE));
+  expected_.emplace(POSTAL_CODE, MISMATCHING_VALUE);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -402,7 +399,7 @@
   address_.postal_code = "000";
 
   filter_.erase(POSTAL_CODE);
-  filter_.insert(std::make_pair(POSTAL_CODE, INVALID_FORMAT));
+  filter_.emplace(POSTAL_CODE, INVALID_FORMAT);
 
   // (POSTAL_CODE, MISMATCHING_VALUE) should not be reported.
 
@@ -415,11 +412,11 @@
   json_[0] = R"({"fmt":"%A"})";
 
   address_.region_code = "rrr";
-  address_.address_line.push_back("aaa");
-  address_.address_line.push_back("P.O. Box");
-  address_.address_line.push_back("aaa");
+  address_.address_line.emplace_back("aaa");
+  address_.address_line.emplace_back("P.O. Box");
+  address_.address_line.emplace_back("aaa");
 
-  expected_.insert(std::make_pair(STREET_ADDRESS, USES_P_O_BOX));
+  expected_.emplace(STREET_ADDRESS, USES_P_O_BOX);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -430,11 +427,11 @@
   json_[0] = R"({"fmt":"%A","languages":"da"})";
 
   address_.region_code = "rrr";
-  address_.address_line.push_back("aaa");
-  address_.address_line.push_back("Postboks");
-  address_.address_line.push_back("aaa");
+  address_.address_line.emplace_back("aaa");
+  address_.address_line.emplace_back("Postboks");
+  address_.address_line.emplace_back("aaa");
 
-  expected_.insert(std::make_pair(STREET_ADDRESS, USES_P_O_BOX));
+  expected_.emplace(STREET_ADDRESS, USES_P_O_BOX);
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -445,9 +442,9 @@
   json_[0] = R"({"fmt":"%A","languages":"da"})";
 
   address_.region_code = "rrr";
-  address_.address_line.push_back("aaa");
-  address_.address_line.push_back("Postfach");
-  address_.address_line.push_back("aaa");
+  address_.address_line.emplace_back("aaa");
+  address_.address_line.emplace_back("Postfach");
+  address_.address_line.emplace_back("aaa");
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
@@ -458,9 +455,9 @@
   json_[0] = R"({"fmt":"%A"})";
 
   address_.region_code = "rrr";
-  address_.address_line.push_back("aaa");
-  address_.address_line.push_back("P.O. Box");
-  address_.address_line.push_back("aaa");
+  address_.address_line.emplace_back("aaa");
+  address_.address_line.emplace_back("P.O. Box");
+  address_.address_line.emplace_back("aaa");
 
   allow_postal_ = true;
 
diff --git a/testdata/countryinfo.txt b/testdata/countryinfo.txt
index e8bb4a4..9d034be 100644
--- a/testdata/countryinfo.txt
+++ b/testdata/countryinfo.txt
@@ -9794,6 +9794,7 @@
 data/CN/黑龙江省/齐齐哈尔市/龙沙区={"id":"data/CN/黑龙江省/齐齐哈尔市/龙沙区","key":"龙沙区","lang":"zh-hans","lname":"Longsha Qu","zipex":"161000"}
 data/CO={"id":"data/CO","key":"CO","name":"COLOMBIA","fmt":"%N%n%O%n%A%n%C, %S","zip":"\\d{6}","zipex":"111221,130001,760011","posturl":"http://www.codigopostal4-72.com.co/codigosPostales/"}
 data/CR={"id":"data/CR","key":"CR","name":"COSTA RICA","fmt":"%N%n%O%n%A%n%Z %C","zip":"\\d{4,5}|\\d{3}-\\d{4}","zipex":"1000,2010,1001","posturl":"https://www.correos.go.cr/nosotros/codigopostal/busqueda.html"}
+data/CU={"id":"data/CU","key":"CU","name":"CUBA"}
 data/CV={"id":"data/CV","key":"CV","name":"CAPE VERDE","lang":"pt","languages":"pt","fmt":"%N%n%O%n%A%n%Z %C%n%S","zip":"\\d{4}","zipex":"7600","state_name_type":"island","sub_keys":"BOA VISTA~BRAVA~FOGO~MAIO~SAL~SANTIAGO~SANTO ANTÃO~SÃO NICOLAU~SÃO VICENTE","sub_isoids":"BV~BR~~MA~SL~~~SN~SV"}
 data/CV/BOA VISTA={"id":"data/CV/BOA VISTA","key":"BOA VISTA","lang":"pt","isoid":"BV"}
 data/CV/BRAVA={"id":"data/CV/BRAVA","key":"BRAVA","lang":"pt","isoid":"BR"}
@@ -10355,6 +10356,7 @@
 data/KN={"id":"data/KN","key":"KN","name":"SAINT KITTS AND NEVIS","lang":"en","languages":"en","fmt":"%N%n%O%n%A%n%C, %S","require":"ACS","state_name_type":"island","sub_keys":"NEVIS~ST. KITTS","sub_isoids":"N~K"}
 data/KN/NEVIS={"id":"data/KN/NEVIS","key":"NEVIS","lang":"en","isoid":"N"}
 data/KN/ST. KITTS={"id":"data/KN/ST. KITTS","key":"ST. KITTS","lang":"en","isoid":"K"}
+data/KP={"id":"data/KP","key":"KP","name":"NORTH KOREA"}
 data/KR={"id":"data/KR","key":"KR","name":"SOUTH KOREA","lang":"ko","languages":"ko","fmt":"%S %C%D%n%A%n%O%n%N%n%Z","lfmt":"%N%n%O%n%A%n%D%n%C%n%S%n%Z","require":"ACSZ","upper":"Z","zip":"\\d{3}[\\-]\\d{3}","zipex":"110-110,699-800","posturl":"http://www.epost.go.kr/search/zipcode/search5.jsp","state_name_type":"do_si","sub_keys":"강원도~경기도~경상남도~경상북도~광주광역시~대구광역시~대전광역시~부산광역시~서울특별시~세종특별자치시~울산광역시~인천광역시~전라남도~전라북도~제주특별자치도~충청남도~충청북도","sub_names":"강원~경기~경남~경북~광주~대구~대전~부산~서울~세종~울산~인천~전남~전북~제주~충남~충북","sub_lnames":"Gangwon~Gyeonggi~Gyeongnam~Gyeongbuk~Gwangju~Daegu~Daejeon~Busan~Seoul~Sejong~Ulsan~Incheon~Jeonnam~Jeonbuk~Jeju~Chungnam~Chungbuk","sub_zips":"2[0-6]|487[\\-]839~4(?:1[0-6]|[2-8])~6[2-7]~7(?:1[2-9]|[3-9])~50[0-36]~7(?:0[0-6]|11)~30[0-25-6]~6[0-1]~1[0-5]~339~68[0-39]~4(?:0[0-79]|17)~5[1-5]~5[6-9]~69[0579]~3(?:[1245]|3[0-8])~3[6-9]","sub_zipexs":"255-815:210-923~427-080:431-088~621-759:668-863~712-861:770-841~501-805:506-358~700-441:711-865~300-091:305-504~609-311:619-872~100-620:151-832~339-014~683-480:689-832~406-131:417-921~516-931:556-891~568-803:595-871~690-808:697-370~314-831:355-770~367-861:395-813","sub_isoids":"42~41~48~47~29~27~30~26~11~~31~28~46~45~49~44~43","sub_mores":"true~true~true~true~true~true~true~true~true~false~true~true~true~true~true~true~true"}
 data/KR/강원도={"id":"data/KR/강원도","key":"강원도","name":"강원","lang":"ko","lname":"Gangwon","zip":"2[0-6]|487[\\-]839","zipex":"255-815:210-923","isoid":"42","sub_keys":"강릉시~고성군~동해시~삼척시~속초시~양구군~양양군~영월군~원주시~인제군~정선군~철원군~춘천시~태백시~평창군~홍천군~화천군~횡성군","sub_lnames":"Gangneung-si~Goseong-gun~Donghae-si~Samcheok-si~Sokcho-si~Yanggu-gun~Yangyang-gun~Yeongwol-gun~Wonju-si~Inje-gun~Jeongseon-gun~Cheorwon-gun~Chuncheon-si~Taebaek-si~Pyeongchang-gun~Hongcheon-gun~Hwacheon-gun~Hoengseong-gun","sub_zips":"210~219~24[05]~245~21[79]~255[\\-]8~215~230~220~25[02]~233~209|269|487[\\-]839~2(?:0[09]|50)~235~232~250~209[\\-]8~225"}
 data/KR/강원도/강릉시={"id":"data/KR/강원도/강릉시","key":"강릉시","lang":"ko","lname":"Gangneung-si","zip":"210"}
@@ -10908,6 +10910,7 @@
 data/SA={"id":"data/SA","key":"SA","name":"SAUDI ARABIA","fmt":"%N%n%O%n%A%n%C %Z","zip":"\\d{5}","zipex":"11564,11187,11142"}
 data/SB={"id":"data/SB","key":"SB","name":"SOLOMON ISLANDS"}
 data/SC={"id":"data/SC","key":"SC","name":"SEYCHELLES","fmt":"%N%n%O%n%A%n%C%n%S","upper":"S","state_name_type":"island"}
+data/SD={"id":"data/SD","key":"SD","name":"SUDAN"}
 data/SE={"id":"data/SE","key":"SE","name":"SWEDEN","fmt":"%O%n%N%n%A%nSE-%Z %C","require":"ACZ","zip":"\\d{3}[ ]?\\d{2}","zipex":"11455,12345,10500","posturl":"http://www.posten.se/sv/Kundservice/Sidor/Sok-postnummer-resultat.aspx","postprefix":"SE-"}
 data/SG={"id":"data/SG","key":"SG","name":"REP. OF SINGAPORE","fmt":"%N%n%O%n%A%nSINGAPORE %Z","require":"AZ","zip":"\\d{6}","zipex":"546080,308125,408600","posturl":"http://www.singpost.com.sg/quick_services/index.htm"}
 data/SH={"id":"data/SH","key":"SH","name":"SAINT HELENA","fmt":"%N%n%O%n%A%n%X%n%C%n%Z","require":"ACZ","upper":"CZ","zip":"(ASCN|STHL) 1ZZ","zipex":"STHL 1ZZ"}
@@ -10965,6 +10968,7 @@
 data/SV/SONSONATE={"id":"data/SV/SONSONATE","key":"SONSONATE","name":"Sonsonate","lang":"es","zip":"CP 23","zipex":"CP 2301","isoid":"SO"}
 data/SV/USULUTAN={"id":"data/SV/USULUTAN","key":"USULUTAN","name":"Usulután","lang":"es","zip":"CP 34","zipex":"CP 3401","isoid":"US"}
 data/SX={"id":"data/SX","key":"SX","name":"SINT MAARTEN"}
+data/SY={"id":"data/SY","key":"SY","name":"SYRIA"}
 data/SZ={"id":"data/SZ","key":"SZ","name":"SWAZILAND","fmt":"%N%n%O%n%A%n%C%n%Z","upper":"ACZ","zip":"[HLMS]\\d{3}","zipex":"H100","posturl":"http://www.sptc.co.sz/swazipost/codes.php"}
 data/TA={"id":"data/TA","key":"TA","name":"TRISTAN DA CUNHA","zip":"TDCU 1ZZ","zipex":"TDCU 1ZZ"}
 data/TC={"id":"data/TC","key":"TC","name":"TURKS AND CAICOS ISLANDS","fmt":"%N%n%O%n%A%n%X%n%C%n%Z","require":"ACZ","upper":"CZ","zip":"TKCA 1ZZ","zipex":"TKCA 1ZZ"}