youguangyin 1 vuosi sitten
commit
0460942d18
100 muutettua tiedostoa jossa 49532 lisäystä ja 0 poistoa
  1. 77 0
      Makefile
  2. 93 0
      config_all.json
  3. 27 0
      expect/eeasy_reboot.expect
  4. 44 0
      expect/eeasy_run.expect
  5. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ar
  6. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/as
  7. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld
  8. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld.bfd
  9. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld.gold
  10. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/nm
  11. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/objcopy
  12. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/objdump
  13. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ranlib
  14. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/readelf
  15. BIN
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/strip
  16. 68 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/algorithm
  17. 648 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/any
  18. 40 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/atomic_word.h
  19. 130 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/basic_file.h
  20. 55 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++allocator.h
  21. 1958 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++config.h
  22. 50 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++io.h
  23. 114 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++locale.h
  24. 40 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/cpu_defines.h
  25. 66 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/ctype_base.h
  26. 76 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/ctype_inline.h
  27. 82 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/cxxabi_tweaks.h
  28. 178 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/error_constants.h
  29. 84 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/extc++.h
  30. 889 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr-default.h
  31. 889 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr-posix.h
  32. 298 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr-single.h
  33. 154 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr.h
  34. 151 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/messages_members.h
  35. 38 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/opt_random.h
  36. 52 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/os_defines.h
  37. 123 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/stdc++.h
  38. 53 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/stdtr1c++.h
  39. 89 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/time_members.h
  40. 38 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/ext/opt_random.h
  41. 378 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/array
  42. 1372 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/atomic
  43. 333 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/auto_ptr.h
  44. 60 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/backward_warning.h
  45. 182 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/binders.h
  46. 170 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hash_fun.h
  47. 599 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hash_map
  48. 567 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hash_set
  49. 1167 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hashtable.h
  50. 182 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/strstream
  51. 855 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/algorithmfwd.h
  52. 605 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/alloc_traits.h
  53. 111 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/allocated_ptr.h
  54. 247 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/allocator.h
  55. 796 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/atomic_base.h
  56. 290 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/atomic_futex.h
  57. 63 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/atomic_lockfree_defines.h
  58. 518 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_ios.h
  59. 188 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_ios.tcc
  60. 6706 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_string.h
  61. 1654 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_string.tcc
  62. 790 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/boost_concept_check.h
  63. 37 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/c++0x_warning.h
  64. 706 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/char_traits.h
  65. 681 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/codecvt.h
  66. 81 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/concept_check.h
  67. 415 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/cpp_type_traits.h
  68. 60 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/cxxabi_forced.h
  69. 80 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/cxxabi_init_exception.h
  70. 1112 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/deque.tcc
  71. 312 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/enable_special_members.h
  72. 78 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/exception.h
  73. 45 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/exception_defines.h
  74. 230 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/exception_ptr.h
  75. 1432 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/forward_list.h
  76. 499 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/forward_list.tcc
  77. 1069 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/fstream.tcc
  78. 110 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/functexcept.h
  79. 274 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/functional_hash.h
  80. 185 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/gslice.h
  81. 218 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/gslice_array.h
  82. 59 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/hash_bytes.h
  83. 2219 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/hashtable.h
  84. 2129 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/hashtable_policy.h
  85. 212 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/indirect_array.h
  86. 104 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/invoke.h
  87. 1079 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/ios_base.h
  88. 1100 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/istream.tcc
  89. 600 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/list.tcc
  90. 853 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_classes.h
  91. 298 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_classes.tcc
  92. 549 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_conv.h
  93. 2653 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets.h
  94. 1377 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets.tcc
  95. 2015 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets_nonio.h
  96. 1507 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets_nonio.tcc
  97. 206 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/localefwd.h
  98. 208 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/mask_array.h
  99. 78 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/memoryfwd.h
  100. 225 0
      gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/move.h

+ 77 - 0
Makefile

@@ -0,0 +1,77 @@
+CC := gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
+CFLAGS := -Wall -Wextra -fPIC -O3
+#   -funroll-loops  -finline-functions  -flto -flto 
+LDFLAGS := -shared  -ldl -lm -lrt -lstdc++fs 
+
+SRCDIR := src
+LIBDIR := lib
+BUILDDIR := build
+
+# 获取src目录下所有cpp文件
+SRCEXT := cpp
+SOURCES := $(wildcard $(SRCDIR)/*.$(SRCEXT))
+
+# 生成目标so文件的路径及名称
+TARGET_LIB := $(LIBDIR)/libasj_ai.so
+
+# 获取头文件路径
+INCLUDE :=	-I include 
+
+
+ifeq ($(NPU_TYPE), EEASY)
+# 亿智库
+NPU_INCLUDE :=	-I npu/eeasy/include \
+				-I npu/eeasy/include/mbase 
+NPU_LDFLAGS := -L npu/eeasy/lib -lopenvx -lopenvx-nn -lnn -lnn_base -lmbase -lax -llog 
+NPU_SOURCES := npu/eeasy/src/EeasyModel.cpp
+NPU_OBJECTS :=  $(BUILDDIR)/EeasyModel.o
+else ifeq ($(NPU_TYPE), AXERA)
+# 爱芯库
+NPU_INCLUDE := -I npu/axera/include \
+			   -I npu/axera/include/axera
+NPU_LDFLAGS := -L npu/axera/lib -lax_run_joint -lax_interpreter_external -lax_interpreter -lax_sys -lax_npu_cv_kit -ldl -lm -lrt -lstdc++fs
+NPU_SOURCES := npu/axera/src/AxeraModel.cpp
+NPU_OBJECTS := $(BUILDDIR)/AxeraModel.o
+CFLAGS += -DAXERA_TARGET_CHIP_AX620
+# else
+#     $(error HJJ提示:写错或者不写平台,需要加 NPU_TYPE=EEASY 或 NPU_TYPE=AXERA)
+endif
+
+CFLAGS += -D$(NPU_TYPE)_CHIP
+# 生成中间目标文件的路径
+OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
+
+$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
+	@mkdir -p $(BUILDDIR)
+	$(CC) $(CFLAGS) $(INCLUDE) $(NPU_INCLUDE) -c -o $@ $<
+
+$(BUILDDIR)/%.o: $(NPU_SOURCES)
+	@mkdir -p $(BUILDDIR)
+	$(CC) $(CFLAGS) $(INCLUDE) $(NPU_INCLUDE) -c -o $@ $<
+
+$(TARGET_LIB): $(OBJECTS) $(NPU_OBJECTS)
+	@mkdir -p $(LIBDIR)
+	$(CC) $^ $(LDFLAGS) $(NPU_LDFLAGS) -o $@
+
+clean:
+	@rm -rf $(BUILDDIR) $(LIBDIR)
+	@rm -rf main
+
+test:
+ifeq ($(NPU_TYPE), EEASY)
+	$(CC) -o main main.cpp npu/eeasy/src/utils.cpp \
+	$(INCLUDE) $(NPU_INCLUDE) \
+	-L$(LIBDIR) -lasj_ai $(NPU_LDFLAGS) \
+	$(CFLAGS)
+else ifeq ($(NPU_TYPE), AXERA)
+	$(CC) -o main main.cpp \
+	$(INCLUDE) $(NPU_INCLUDE) \
+	-L$(LIBDIR) -lasj_ai $(NPU_LDFLAGS) \
+	$(CFLAGS)
+# else
+#     $(error HJJ提示:写错或者不写平台,需要加 NPU_TYPE=EEASY 或 NPU_TYPE=AXERA)
+endif
+
+print-%  : ; @echo $* = $($*)
+
+

+ 93 - 0
config_all.json

@@ -0,0 +1,93 @@
+{
+    "model": {
+        "21": {
+            "eeasy": {
+                "model_bin_path": "/share/models/eeasy/yolov7_brid_prune_288x512.bin",
+                "model_ezb_path": "/share/models/eeasy/yolov7_brid_prune_288x512.ezb",
+                "model_format": "int8",
+                "freq_nu": 700,
+                "freq_vu": 700,
+                "ndk-version": "1.2-20221231",
+                "need_nu_freq": true,
+                "need_vu_freq": true
+            },
+            "axera": {
+                "model_path": "/share/models/axera/yolov5s.joint"
+            },
+            "info": "火焰模型编译的库根据编译的库flag进行检查",
+            "label": [
+                "person",
+                "bicycle"
+            ],
+            "name": "yolov5",
+            "version": "1.1-20230101-826-c215xxxx"
+        }
+    },
+    "pipeline": {
+        "91": {
+            "21": {
+                "class_attributes": {
+                    "all": 0.5,
+                    "apple": 0.5,
+                    "iou_thresh": 0.45,
+                    "topk": 50
+                }
+            },
+            "enable": true,
+            "info": "亿智鸟检测业务",
+            "name": "bird_detect",
+            "step": [
+                11,
+                21,
+                31
+            ]
+        }
+    },
+    "post_process": {
+        "31": {
+            "name": "yololayer_nms",
+            "yolo_anchor": [
+                10,
+                13,
+                16,
+                30,
+                33,
+                23,
+                30,
+                61,
+                62,
+                45,
+                59,
+                119,
+                116,
+                90,
+                156,
+                198,
+                373,
+                326
+            ]
+        }
+    },
+    "pre_process": {
+        "11": {
+            "eeasy": {
+                "fmt": "NNA_BGRA",
+                "h": 288,
+                "w": 512
+            },
+            "axera":{
+                "fmt": "BGR",
+                "h": 640,
+                "w": 640
+            },
+            "info": "根据编译的库flag进行检查",
+            "name": "dev1ch1to640w360h",
+            "src": {
+                "fmt": "YUV420",
+                "h": 288,
+                "stride": 8,
+                "w": 512
+            }
+        }
+    }
+}

+ 27 - 0
expect/eeasy_reboot.expect

@@ -0,0 +1,27 @@
+#!/usr/bin/expect
+set TIMEOUT 20
+set SLEEP_DURATION 0.5
+
+set hostname "192.168.1.16"
+set username "root"
+set password "123456asj"
+exec rm -f output.txt
+set OUTPUT_FILE "output.txt"
+log_file -a $OUTPUT_FILE
+
+
+
+proc board {} {
+    global hostname username password
+    spawn telnet $hostname
+    expect "login: "
+    send "$username\r"
+    expect "Password: "
+    send "$password\r"
+    expect "# "
+    send "reboot \r"
+    expect eof
+}
+board
+log_file
+# exec code output.txt

+ 44 - 0
expect/eeasy_run.expect

@@ -0,0 +1,44 @@
+#!/usr/bin/expect
+set TIMEOUT 20
+set SLEEP_DURATION 0.5
+
+set hostname "192.168.1.16"
+set username "root"
+set password "123456asj"
+exec rm -f output.txt
+set OUTPUT_FILE "output.txt"
+log_file -a $OUTPUT_FILE
+
+
+proc make {} {
+    spawn make clean
+    expect "clean completed"
+    spawn make -j24
+    expect "make completed"
+    spawn make test -j24
+    expect "test completed"
+}
+
+proc board {} {
+    global hostname username password
+    spawn telnet $hostname
+    expect "login: "
+    send "$username\r"
+    expect "Password: "
+    send "$password\r"
+    expect "# "
+    send "umount  -l /share \r"
+    expect "# "
+    send "mount -o nolock 192.168.1.234:/data/eeasy/asj_v3 /share\r"
+    expect "# "
+    send "cd /share\r"
+    expect "# "
+    send "sh run.sh\r"
+    expect "# "
+    send "exit\n"
+    expect eof
+}
+make
+board
+log_file
+# exec code output.txt

BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ar


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/as


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld.bfd


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld.gold


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/nm


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/objcopy


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/objdump


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ranlib


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/readelf


BIN
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/strip


+ 68 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/algorithm

@@ -0,0 +1,68 @@
+// <algorithm> -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/algorithm
+ *  This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ALGORITHM
+#define _GLIBCXX_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <utility> // UK-300.
+#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h>
+
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algorithm>
+#endif
+
+#endif /* _GLIBCXX_ALGORITHM */

+ 648 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/any

@@ -0,0 +1,648 @@
+// <any> -*- C++ -*-
+
+// Copyright (C) 2014-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/any
+ *  This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ANY
+#define _GLIBCXX_ANY 1
+
+#pragma GCC system_header
+
+#if __cplusplus >= 201703L
+
+#include <typeinfo>
+#include <new>
+#include <utility>
+#include <type_traits>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @addtogroup utilities
+   *  @{
+   */
+
+  /**
+   *  @brief Exception class thrown by a failed @c any_cast
+   *  @ingroup exceptions
+   */
+  class bad_any_cast : public bad_cast
+  {
+  public:
+    virtual const char* what() const noexcept { return "bad any_cast"; }
+  };
+
+  [[gnu::noreturn]] inline void __throw_bad_any_cast()
+  {
+#if __cpp_exceptions
+    throw bad_any_cast{};
+#else
+    __builtin_abort();
+#endif
+  }
+
+#define __cpp_lib_any 201606L
+
+  /**
+   *  @brief A type-safe container of any type.
+   *
+   *  An @c any object's state is either empty or it stores a contained object
+   *  of CopyConstructible type.
+   */
+  class any
+  {
+    // Holds either pointer to a heap object or the contained object itself.
+    union _Storage
+    {
+      constexpr _Storage() : _M_ptr{nullptr} {}
+
+      // Prevent trivial copies of this type, buffer might hold a non-POD.
+      _Storage(const _Storage&) = delete;
+      _Storage& operator=(const _Storage&) = delete;
+
+      void* _M_ptr;
+      aligned_storage<sizeof(_M_ptr), alignof(void*)>::type _M_buffer;
+    };
+
+    template<typename _Tp, typename _Safe = is_nothrow_move_constructible<_Tp>,
+	     bool _Fits = (sizeof(_Tp) <= sizeof(_Storage))
+			  && (alignof(_Tp) <= alignof(_Storage))>
+      using _Internal = std::integral_constant<bool, _Safe::value && _Fits>;
+
+    template<typename _Tp>
+      struct _Manager_internal; // uses small-object optimization
+
+    template<typename _Tp>
+      struct _Manager_external; // creates contained object on the heap
+
+    template<typename _Tp>
+      using _Manager = conditional_t<_Internal<_Tp>::value,
+				     _Manager_internal<_Tp>,
+				     _Manager_external<_Tp>>;
+
+    template<typename _Tp, typename _Decayed = decay_t<_Tp>>
+      using _Decay = enable_if_t<!is_same<_Decayed, any>::value, _Decayed>;
+
+    /// Emplace with an object created from @p __args as the contained object.
+    template <typename _Tp, typename... _Args,
+	      typename _Mgr = _Manager<_Tp>>
+      void __do_emplace(_Args&&... __args)
+      {
+	reset();
+        _Mgr::_S_create(_M_storage, std::forward<_Args>(__args)...);
+	_M_manager = &_Mgr::_S_manage;
+      }
+
+    /// Emplace with an object created from @p __il and @p __args as
+    /// the contained object.
+    template <typename _Tp, typename _Up, typename... _Args,
+	      typename _Mgr = _Manager<_Tp>>
+      void __do_emplace(initializer_list<_Up> __il, _Args&&... __args)
+      {
+	reset();
+        _Mgr::_S_create(_M_storage, __il, std::forward<_Args>(__args)...);
+	_M_manager = &_Mgr::_S_manage;
+      }
+
+  public:
+    // construct/destruct
+
+    /// Default constructor, creates an empty object.
+    constexpr any() noexcept : _M_manager(nullptr) { }
+
+    /// Copy constructor, copies the state of @p __other
+    any(const any& __other)
+    {
+      if (!__other.has_value())
+	_M_manager = nullptr;
+      else
+	{
+	  _Arg __arg;
+	  __arg._M_any = this;
+	  __other._M_manager(_Op_clone, &__other, &__arg);
+	}
+    }
+
+    /**
+     * @brief Move constructor, transfer the state from @p __other
+     *
+     * @post @c !__other.has_value() (this postcondition is a GNU extension)
+     */
+    any(any&& __other) noexcept
+    {
+      if (!__other.has_value())
+	_M_manager = nullptr;
+      else
+	{
+	  _Arg __arg;
+	  __arg._M_any = this;
+	  __other._M_manager(_Op_xfer, &__other, &__arg);
+	}
+    }
+
+    template <typename _Res, typename _Tp, typename... _Args>
+    using __any_constructible =
+      enable_if<__and_<is_copy_constructible<_Tp>,
+			 is_constructible<_Tp, _Args...>>::value,
+		  _Res>;
+
+    template <typename _Tp, typename... _Args>
+    using __any_constructible_t =
+      typename __any_constructible<bool, _Tp, _Args...>::type;
+
+    /// Construct with a copy of @p __value as the contained object.
+    template <typename _ValueType, typename _Tp = _Decay<_ValueType>,
+	      typename _Mgr = _Manager<_Tp>,
+              __any_constructible_t<_Tp, _ValueType&&> = true,
+	      enable_if_t<!__is_in_place_type<_Tp>::value, bool> = true>
+      any(_ValueType&& __value)
+      : _M_manager(&_Mgr::_S_manage)
+      {
+        _Mgr::_S_create(_M_storage, std::forward<_ValueType>(__value));
+      }
+
+    /// Construct with a copy of @p __value as the contained object.
+    template <typename _ValueType, typename _Tp = _Decay<_ValueType>,
+	      typename _Mgr = _Manager<_Tp>,
+              enable_if_t<__and_<is_copy_constructible<_Tp>,
+				 __not_<is_constructible<_Tp, _ValueType&&>>,
+			         __not_<__is_in_place_type<_Tp>>>::value,
+			  bool> = false>
+      any(_ValueType&& __value)
+      : _M_manager(&_Mgr::_S_manage)
+      {
+        _Mgr::_S_create(_M_storage, __value);
+      }
+
+    /// Construct with an object created from @p __args as the contained object.
+    template <typename _ValueType, typename... _Args,
+	      typename _Tp = _Decay<_ValueType>,
+	      typename _Mgr = _Manager<_Tp>,
+              __any_constructible_t<_Tp, _Args&&...> = false>
+      explicit
+      any(in_place_type_t<_ValueType>, _Args&&... __args)
+      : _M_manager(&_Mgr::_S_manage)
+      {
+        _Mgr::_S_create(_M_storage, std::forward<_Args>(__args)...);
+      }
+
+    /// Construct with an object created from @p __il and @p __args as
+    /// the contained object.
+    template <typename _ValueType, typename _Up, typename... _Args,
+	      typename _Tp = _Decay<_ValueType>,
+	      typename _Mgr = _Manager<_Tp>,
+              __any_constructible_t<_Tp, initializer_list<_Up>,
+				    _Args&&...> = false>
+      explicit
+      any(in_place_type_t<_ValueType>,
+	  initializer_list<_Up> __il, _Args&&... __args)
+      : _M_manager(&_Mgr::_S_manage)
+      {
+        _Mgr::_S_create(_M_storage, __il, std::forward<_Args>(__args)...);
+      }
+
+    /// Destructor, calls @c reset()
+    ~any() { reset(); }
+
+    // assignments
+
+    /// Copy the state of another object.
+    any& operator=(const any& __rhs)
+    {
+      *this = any(__rhs);
+      return *this;
+    }
+
+    /**
+     * @brief Move assignment operator
+     *
+     * @post @c !__rhs.has_value() (not guaranteed for other implementations)
+     */
+    any& operator=(any&& __rhs) noexcept
+    {
+      if (!__rhs.has_value())
+	reset();
+      else if (this != &__rhs)
+	{
+	  reset();
+	  _Arg __arg;
+	  __arg._M_any = this;
+	  __rhs._M_manager(_Op_xfer, &__rhs, &__arg);
+	}
+      return *this;
+    }
+
+    /// Store a copy of @p __rhs as the contained object.
+    template<typename _ValueType>
+      enable_if_t<is_copy_constructible<_Decay<_ValueType>>::value, any&>
+      operator=(_ValueType&& __rhs)
+      {
+	*this = any(std::forward<_ValueType>(__rhs));
+	return *this;
+      }
+
+    /// Emplace with an object created from @p __args as the contained object.
+    template <typename _ValueType, typename... _Args>
+      typename __any_constructible<_Decay<_ValueType>&,
+				   _Decay<_ValueType>, _Args&&...>::type
+      emplace(_Args&&... __args)
+      {
+	__do_emplace<_Decay<_ValueType>>(std::forward<_Args>(__args)...);
+	any::_Arg __arg;
+	this->_M_manager(any::_Op_access, this, &__arg);
+	return *static_cast<_Decay<_ValueType>*>(__arg._M_obj);
+      }
+
+    /// Emplace with an object created from @p __il and @p __args as
+    /// the contained object.
+    template <typename _ValueType, typename _Up, typename... _Args>
+      typename __any_constructible<_Decay<_ValueType>&,
+				   _Decay<_ValueType>,
+				   initializer_list<_Up>,
+				   _Args&&...>::type
+      emplace(initializer_list<_Up> __il, _Args&&... __args)
+      {
+	__do_emplace<_Decay<_ValueType>, _Up>(__il,
+					      std::forward<_Args>(__args)...);
+	any::_Arg __arg;
+	this->_M_manager(any::_Op_access, this, &__arg);
+	return *static_cast<_Decay<_ValueType>*>(__arg._M_obj);
+      }
+
+    // modifiers
+
+    /// If not empty, destroy the contained object.
+    void reset() noexcept
+    {
+      if (has_value())
+      {
+	_M_manager(_Op_destroy, this, nullptr);
+	_M_manager = nullptr;
+      }
+    }
+
+    /// Exchange state with another object.
+    void swap(any& __rhs) noexcept
+    {
+      if (!has_value() && !__rhs.has_value())
+	return;
+
+      if (has_value() && __rhs.has_value())
+	{
+	  if (this == &__rhs)
+	    return;
+
+	  any __tmp;
+	  _Arg __arg;
+	  __arg._M_any = &__tmp;
+	  __rhs._M_manager(_Op_xfer, &__rhs, &__arg);
+	  __arg._M_any = &__rhs;
+	  _M_manager(_Op_xfer, this, &__arg);
+	  __arg._M_any = this;
+	  __tmp._M_manager(_Op_xfer, &__tmp, &__arg);
+	}
+      else
+	{
+	  any* __empty = !has_value() ? this : &__rhs;
+	  any* __full = !has_value() ? &__rhs : this;
+	  _Arg __arg;
+	  __arg._M_any = __empty;
+	  __full->_M_manager(_Op_xfer, __full, &__arg);
+	}
+    }
+
+    // observers
+
+    /// Reports whether there is a contained object or not.
+    bool has_value() const noexcept { return _M_manager != nullptr; }
+
+#if __cpp_rtti
+    /// The @c typeid of the contained object, or @c typeid(void) if empty.
+    const type_info& type() const noexcept
+    {
+      if (!has_value())
+	return typeid(void);
+      _Arg __arg;
+      _M_manager(_Op_get_type_info, this, &__arg);
+      return *__arg._M_typeinfo;
+    }
+#endif
+
+    template<typename _Tp>
+      static constexpr bool __is_valid_cast()
+      { return __or_<is_reference<_Tp>, is_copy_constructible<_Tp>>::value; }
+
+  private:
+    enum _Op {
+	_Op_access, _Op_get_type_info, _Op_clone, _Op_destroy, _Op_xfer
+    };
+
+    union _Arg
+    {
+	void* _M_obj;
+	const std::type_info* _M_typeinfo;
+	any* _M_any;
+    };
+
+    void (*_M_manager)(_Op, const any*, _Arg*);
+    _Storage _M_storage;
+
+    template<typename _Tp>
+      friend void* __any_caster(const any* __any);
+
+    // Manage in-place contained object.
+    template<typename _Tp>
+      struct _Manager_internal
+      {
+	static void
+	_S_manage(_Op __which, const any* __anyp, _Arg* __arg);
+
+	template<typename _Up>
+	  static void
+	  _S_create(_Storage& __storage, _Up&& __value)
+	  {
+	    void* __addr = &__storage._M_buffer;
+	    ::new (__addr) _Tp(std::forward<_Up>(__value));
+	  }
+
+	template<typename... _Args>
+	  static void
+	  _S_create(_Storage& __storage, _Args&&... __args)
+	  {
+	    void* __addr = &__storage._M_buffer;
+	    ::new (__addr) _Tp(std::forward<_Args>(__args)...);
+	  }
+      };
+
+    // Manage external contained object.
+    template<typename _Tp>
+      struct _Manager_external
+      {
+	static void
+	_S_manage(_Op __which, const any* __anyp, _Arg* __arg);
+
+	template<typename _Up>
+	  static void
+	  _S_create(_Storage& __storage, _Up&& __value)
+	  {
+	    __storage._M_ptr = new _Tp(std::forward<_Up>(__value));
+	  }
+	template<typename... _Args>
+	  static void
+	  _S_create(_Storage& __storage, _Args&&... __args)
+	  {
+	    __storage._M_ptr = new _Tp(std::forward<_Args>(__args)...);
+	  }
+      };
+  };
+
+  /// Exchange the states of two @c any objects.
+  inline void swap(any& __x, any& __y) noexcept { __x.swap(__y); }
+
+  /// Create an any holding a @c _Tp constructed from @c __args.
+  template <typename _Tp, typename... _Args>
+    any make_any(_Args&&... __args)
+    {
+      return any(in_place_type<_Tp>, std::forward<_Args>(__args)...);
+    }
+
+  /// Create an any holding a @c _Tp constructed from @c __il and @c __args.
+  template <typename _Tp, typename _Up, typename... _Args>
+    any make_any(initializer_list<_Up> __il, _Args&&... __args)
+    {
+      return any(in_place_type<_Tp>, __il, std::forward<_Args>(__args)...);
+    }
+
+  template <typename _Tp>
+    using _AnyCast = remove_cv_t<remove_reference_t<_Tp>>;
+  /**
+   * @brief Access the contained object.
+   *
+   * @tparam  _ValueType  A const-reference or CopyConstructible type.
+   * @param   __any       The object to access.
+   * @return  The contained object.
+   * @throw   bad_any_cast If <code>
+   *          __any.type() != typeid(remove_reference_t<_ValueType>)
+   *          </code>
+   */
+  template<typename _ValueType>
+    inline _ValueType any_cast(const any& __any)
+    {
+      static_assert(any::__is_valid_cast<_ValueType>(),
+	  "Template argument must be a reference or CopyConstructible type");
+      auto __p = any_cast<_AnyCast<_ValueType>>(&__any);
+      if (__p)
+	return static_cast<_ValueType>(*__p);
+      __throw_bad_any_cast();
+    }
+
+  /**
+   * @brief Access the contained object.
+   *
+   * @tparam  _ValueType  A reference or CopyConstructible type.
+   * @param   __any       The object to access.
+   * @return  The contained object.
+   * @throw   bad_any_cast If <code>
+   *          __any.type() != typeid(remove_reference_t<_ValueType>)
+   *          </code>
+   *
+   * @{
+   */
+  template<typename _ValueType>
+    inline _ValueType any_cast(any& __any)
+    {
+      static_assert(any::__is_valid_cast<_ValueType>(),
+	  "Template argument must be a reference or CopyConstructible type");
+      auto __p = any_cast<_AnyCast<_ValueType>>(&__any);
+      if (__p)
+	return static_cast<_ValueType>(*__p);
+      __throw_bad_any_cast();
+    }
+
+  template<typename _ValueType,
+           typename enable_if<!is_move_constructible<_ValueType>::value
+                              || is_lvalue_reference<_ValueType>::value,
+                              bool>::type = true>
+    inline _ValueType any_cast(any&& __any)
+    {
+      static_assert(any::__is_valid_cast<_ValueType>(),
+	  "Template argument must be a reference or CopyConstructible type");
+      auto __p = any_cast<_AnyCast<_ValueType>>(&__any);
+      if (__p)
+	return static_cast<_ValueType>(*__p);
+      __throw_bad_any_cast();
+    }
+
+  template<typename _ValueType,
+           typename enable_if<is_move_constructible<_ValueType>::value
+                              && !is_lvalue_reference<_ValueType>::value,
+                              bool>::type = false>
+    inline _ValueType any_cast(any&& __any)
+    {
+      static_assert(any::__is_valid_cast<_ValueType>(),
+	  "Template argument must be a reference or CopyConstructible type");
+      auto __p = any_cast<_AnyCast<_ValueType>>(&__any);
+      if (__p)
+	return static_cast<_ValueType>(std::move(*__p));
+      __throw_bad_any_cast();
+    }
+  // @}
+
+  /// @cond undocumented
+  template<typename _Tp>
+    void* __any_caster(const any* __any)
+    {
+      // any_cast<T> returns non-null if __any->type() == typeid(T) and
+      // typeid(T) ignores cv-qualifiers so remove them:
+      using _Up = remove_cv_t<_Tp>;
+      // The contained value has a decayed type, so if decay_t<U> is not U,
+      // then it's not possible to have a contained value of type U:
+      if constexpr (!is_same_v<decay_t<_Up>, _Up>)
+	return nullptr;
+      // Only copy constructible types can be used for contained values:
+      else if constexpr (!is_copy_constructible_v<_Up>)
+	return nullptr;
+      // First try comparing function addresses, which works without RTTI
+      else if (__any->_M_manager == &any::_Manager<_Up>::_S_manage
+#if __cpp_rtti
+	  || __any->type() == typeid(_Tp)
+#endif
+	  )
+	{
+	  any::_Arg __arg;
+	  __any->_M_manager(any::_Op_access, __any, &__arg);
+	  return __arg._M_obj;
+	}
+      return nullptr;
+    }
+  /// @endcond
+
+  /**
+   * @brief Access the contained object.
+   *
+   * @tparam  _ValueType  The type of the contained object.
+   * @param   __any       A pointer to the object to access.
+   * @return  The address of the contained object if <code>
+   *          __any != nullptr && __any.type() == typeid(_ValueType)
+   *          </code>, otherwise a null pointer.
+   *
+   * @{
+   */
+  template<typename _ValueType>
+    inline const _ValueType* any_cast(const any* __any) noexcept
+    {
+      if constexpr (is_object_v<_ValueType>)
+	if (__any)
+	  return static_cast<_ValueType*>(__any_caster<_ValueType>(__any));
+      return nullptr;
+    }
+
+  template<typename _ValueType>
+    inline _ValueType* any_cast(any* __any) noexcept
+    {
+      if constexpr (is_object_v<_ValueType>)
+	if (__any)
+	  return static_cast<_ValueType*>(__any_caster<_ValueType>(__any));
+      return nullptr;
+    }
+  // @}
+
+  template<typename _Tp>
+    void
+    any::_Manager_internal<_Tp>::
+    _S_manage(_Op __which, const any* __any, _Arg* __arg)
+    {
+      // The contained object is in _M_storage._M_buffer
+      auto __ptr = reinterpret_cast<const _Tp*>(&__any->_M_storage._M_buffer);
+      switch (__which)
+      {
+      case _Op_access:
+	__arg->_M_obj = const_cast<_Tp*>(__ptr);
+	break;
+      case _Op_get_type_info:
+#if __cpp_rtti
+	__arg->_M_typeinfo = &typeid(_Tp);
+#endif
+	break;
+      case _Op_clone:
+	::new(&__arg->_M_any->_M_storage._M_buffer) _Tp(*__ptr);
+	__arg->_M_any->_M_manager = __any->_M_manager;
+	break;
+      case _Op_destroy:
+	__ptr->~_Tp();
+	break;
+      case _Op_xfer:
+	::new(&__arg->_M_any->_M_storage._M_buffer) _Tp
+	  (std::move(*const_cast<_Tp*>(__ptr)));
+	__ptr->~_Tp();
+	__arg->_M_any->_M_manager = __any->_M_manager;
+	const_cast<any*>(__any)->_M_manager = nullptr;
+	break;
+      }
+    }
+
+  template<typename _Tp>
+    void
+    any::_Manager_external<_Tp>::
+    _S_manage(_Op __which, const any* __any, _Arg* __arg)
+    {
+      // The contained object is *_M_storage._M_ptr
+      auto __ptr = static_cast<const _Tp*>(__any->_M_storage._M_ptr);
+      switch (__which)
+      {
+      case _Op_access:
+	__arg->_M_obj = const_cast<_Tp*>(__ptr);
+	break;
+      case _Op_get_type_info:
+#if __cpp_rtti
+	__arg->_M_typeinfo = &typeid(_Tp);
+#endif
+	break;
+      case _Op_clone:
+	__arg->_M_any->_M_storage._M_ptr = new _Tp(*__ptr);
+	__arg->_M_any->_M_manager = __any->_M_manager;
+	break;
+      case _Op_destroy:
+	delete __ptr;
+	break;
+      case _Op_xfer:
+	__arg->_M_any->_M_storage._M_ptr = __any->_M_storage._M_ptr;
+	__arg->_M_any->_M_manager = __any->_M_manager;
+	const_cast<any*>(__any)->_M_manager = nullptr;
+	break;
+      }
+    }
+
+  /// @}
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif // C++14
+
+#endif // _GLIBCXX_ANY

+ 40 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/atomic_word.h

@@ -0,0 +1,40 @@
+// Low-level type for atomic operations -*- C++ -*-
+
+// Copyright (C) 2004-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file atomic_word.h
+ *  This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_WORD_H
+#define _GLIBCXX_ATOMIC_WORD_H	1
+
+typedef int _Atomic_word;
+
+
+// This is a memory order acquire fence.
+#define _GLIBCXX_READ_MEM_BARRIER __atomic_thread_fence (__ATOMIC_ACQUIRE)
+// This is a memory order release fence.
+#define _GLIBCXX_WRITE_MEM_BARRIER __atomic_thread_fence (__ATOMIC_RELEASE)
+
+#endif

+ 130 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/basic_file.h

@@ -0,0 +1,130 @@
+// Wrapper of C-language FILE struct -*- C++ -*-
+
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 27.8  File-based streams
+//
+
+/** @file bits/basic_file.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ios}
+ */
+
+#ifndef _GLIBCXX_BASIC_FILE_STDIO_H
+#define _GLIBCXX_BASIC_FILE_STDIO_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/c++io.h>  // for __c_lock and __c_file
+#include <bits/move.h>   // for swap
+#include <ios>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Generic declaration.
+  template<typename _CharT>
+    class __basic_file;
+
+  // Specialization.
+  template<>
+    class __basic_file<char>
+    {
+      // Underlying data source/sink.
+      __c_file* 	_M_cfile;
+
+      // True iff we opened _M_cfile, and thus must close it ourselves.
+      bool 		_M_cfile_created;
+
+    public:
+      __basic_file(__c_lock* __lock = 0) throw ();
+
+#if __cplusplus >= 201103L
+      __basic_file(__basic_file&& __rv, __c_lock* __lock = 0) noexcept
+      : _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created)
+      {
+	__rv._M_cfile = nullptr;
+	__rv._M_cfile_created = false;
+      }
+
+      __basic_file& operator=(const __basic_file&) = delete;
+      __basic_file& operator=(__basic_file&&) = delete;
+
+      void
+      swap(__basic_file& __f) noexcept
+      {
+	std::swap(_M_cfile, __f._M_cfile);
+	std::swap(_M_cfile_created, __f._M_cfile_created);
+      }
+#endif
+
+      __basic_file*
+      open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
+
+      __basic_file*
+      sys_open(__c_file* __file, ios_base::openmode);
+
+      __basic_file*
+      sys_open(int __fd, ios_base::openmode __mode) throw ();
+
+      __basic_file*
+      close();
+
+      _GLIBCXX_PURE bool
+      is_open() const throw ();
+
+      _GLIBCXX_PURE int
+      fd() throw ();
+
+      _GLIBCXX_PURE __c_file*
+      file() throw ();
+
+      ~__basic_file();
+
+      streamsize
+      xsputn(const char* __s, streamsize __n);
+
+      streamsize
+      xsputn_2(const char* __s1, streamsize __n1,
+	       const char* __s2, streamsize __n2);
+
+      streamsize
+      xsgetn(char* __s, streamsize __n);
+
+      streamoff
+      seekoff(streamoff __off, ios_base::seekdir __way) throw ();
+
+      int
+      sync();
+
+      streamsize
+      showmanyc();
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 55 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++allocator.h

@@ -0,0 +1,55 @@
+// Base to std::allocator -*- C++ -*-
+
+// Copyright (C) 2004-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/c++allocator.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{memory}
+ */
+
+#ifndef _GLIBCXX_CXX_ALLOCATOR_H
+#define _GLIBCXX_CXX_ALLOCATOR_H 1
+
+#include <ext/new_allocator.h>
+
+#if __cplusplus >= 201103L
+namespace std
+{
+  /**
+   *  @brief  An alias to the base class for std::allocator.
+   *  @ingroup allocators
+   *
+   *  Used to set the std::allocator base class to
+   *  __gnu_cxx::new_allocator.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+    */
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
+}
+#else
+// Define new_allocator as the base class to std::allocator.
+# define __allocator_base  __gnu_cxx::new_allocator
+#endif
+
+#endif

+ 1958 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++config.h

@@ -0,0 +1,1958 @@
+// Predefined symbols and macros -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/c++config.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _GLIBCXX_CXX_CONFIG_H
+#define _GLIBCXX_CXX_CONFIG_H 1
+
+// The major release number for the GCC release the C++ library belongs to.
+#define _GLIBCXX_RELEASE 7
+
+// The datestamp of the C++ library in compressed ISO date format.
+#define __GLIBCXX__ 20191114
+
+// Macros for various attributes.
+//   _GLIBCXX_PURE
+//   _GLIBCXX_CONST
+//   _GLIBCXX_NORETURN
+//   _GLIBCXX_NOTHROW
+//   _GLIBCXX_VISIBILITY
+#ifndef _GLIBCXX_PURE
+# define _GLIBCXX_PURE __attribute__ ((__pure__))
+#endif
+
+#ifndef _GLIBCXX_CONST
+# define _GLIBCXX_CONST __attribute__ ((__const__))
+#endif
+
+#ifndef _GLIBCXX_NORETURN
+# define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
+#endif
+
+// See below for C++
+#ifndef _GLIBCXX_NOTHROW
+# ifndef __cplusplus
+#  define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
+# endif
+#endif
+
+// Macros for visibility attributes.
+//   _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+//   _GLIBCXX_VISIBILITY
+# define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1
+
+#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+# define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
+#else
+// If this is not supplied by the OS-specific or CPU-specific
+// headers included below, it will be defined to an empty default.
+# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
+#endif
+
+// Macros for deprecated attributes.
+//   _GLIBCXX_USE_DEPRECATED
+//   _GLIBCXX_DEPRECATED
+#ifndef _GLIBCXX_USE_DEPRECATED
+# define _GLIBCXX_USE_DEPRECATED 1
+#endif
+
+#if defined(__DEPRECATED) && (__cplusplus >= 201103L)
+# define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GLIBCXX_DEPRECATED
+#endif
+
+// Macros for ABI tag attributes.
+#ifndef _GLIBCXX_ABI_TAG_CXX11
+# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
+#endif
+
+
+#if __cplusplus
+
+// Macro for constexpr, to support in mixed 03/0x mode.
+#ifndef _GLIBCXX_CONSTEXPR
+# if __cplusplus >= 201103L
+#  define _GLIBCXX_CONSTEXPR constexpr
+#  define _GLIBCXX_USE_CONSTEXPR constexpr
+# else
+#  define _GLIBCXX_CONSTEXPR
+#  define _GLIBCXX_USE_CONSTEXPR const
+# endif
+#endif
+
+#ifndef _GLIBCXX14_CONSTEXPR
+# if __cplusplus >= 201402L
+#  define _GLIBCXX14_CONSTEXPR constexpr
+# else
+#  define _GLIBCXX14_CONSTEXPR
+# endif
+#endif
+
+#ifndef _GLIBCXX17_CONSTEXPR
+# if __cplusplus > 201402L
+#  define _GLIBCXX17_CONSTEXPR constexpr
+# else
+#  define _GLIBCXX17_CONSTEXPR
+# endif
+#endif
+
+#ifndef _GLIBCXX17_INLINE
+# if __cplusplus > 201402L
+#  define _GLIBCXX17_INLINE inline
+# else
+#  define _GLIBCXX17_INLINE
+# endif
+#endif
+
+// Macro for noexcept, to support in mixed 03/0x mode.
+#ifndef _GLIBCXX_NOEXCEPT
+# if __cplusplus >= 201103L
+#  define _GLIBCXX_NOEXCEPT noexcept
+#  define _GLIBCXX_NOEXCEPT_IF(_COND) noexcept(_COND)
+#  define _GLIBCXX_USE_NOEXCEPT noexcept
+#  define _GLIBCXX_THROW(_EXC)
+# else
+#  define _GLIBCXX_NOEXCEPT
+#  define _GLIBCXX_NOEXCEPT_IF(_COND)
+#  define _GLIBCXX_USE_NOEXCEPT throw()
+#  define _GLIBCXX_THROW(_EXC) throw(_EXC)
+# endif
+#endif
+
+#ifndef _GLIBCXX_NOTHROW
+# define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT
+#endif
+
+#ifndef _GLIBCXX_THROW_OR_ABORT
+# if __cpp_exceptions
+#  define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC))
+# else
+#  define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort())
+# endif
+#endif
+
+#if __cpp_noexcept_function_type
+#define _GLIBCXX_NOEXCEPT_PARM , bool _NE
+#define _GLIBCXX_NOEXCEPT_QUAL noexcept (_NE)
+#else
+#define _GLIBCXX_NOEXCEPT_PARM
+#define _GLIBCXX_NOEXCEPT_QUAL
+#endif
+
+// Macro for extern template, ie controlling template linkage via use
+// of extern keyword on template declaration. As documented in the g++
+// manual, it inhibits all implicit instantiations and is used
+// throughout the library to avoid multiple weak definitions for
+// required types that are already explicitly instantiated in the
+// library binary. This substantially reduces the binary size of
+// resulting executables.
+// Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern
+// templates only in basic_string, thus activating its debug-mode
+// checks even at -O0.
+# define _GLIBCXX_EXTERN_TEMPLATE 1
+
+/*
+  Outline of libstdc++ namespaces.
+
+  namespace std
+  {
+    namespace __debug { }
+    namespace __parallel { }
+    namespace __profile { }
+    namespace __cxx1998 { }
+
+    namespace __detail {
+      namespace __variant { }				// C++17
+    }
+
+    namespace rel_ops { }
+
+    namespace tr1
+    {
+      namespace placeholders { }
+      namespace regex_constants { }
+      namespace __detail { }
+    }
+
+    namespace tr2 { }
+    
+    namespace decimal { }
+
+    namespace chrono { }				// C++11
+    namespace placeholders { }				// C++11
+    namespace regex_constants { }			// C++11
+    namespace this_thread { }				// C++11
+    inline namespace literals {				// C++14
+      inline namespace chrono_literals { }		// C++14
+      inline namespace complex_literals { }		// C++14
+      inline namespace string_literals { }		// C++14
+      inline namespace string_view_literals { }		// C++17
+    }
+  }
+
+  namespace abi { }
+
+  namespace __gnu_cxx
+  {
+    namespace __detail { }
+  }
+
+  For full details see:
+  http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html
+*/
+namespace std
+{
+  typedef __SIZE_TYPE__ 	size_t;
+  typedef __PTRDIFF_TYPE__	ptrdiff_t;
+
+#if __cplusplus >= 201103L
+  typedef decltype(nullptr)	nullptr_t;
+#endif
+}
+
+# define _GLIBCXX_USE_DUAL_ABI 1
+
+#if ! _GLIBCXX_USE_DUAL_ABI
+// Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI
+# undef _GLIBCXX_USE_CXX11_ABI
+#endif
+
+#ifndef _GLIBCXX_USE_CXX11_ABI
+# define _GLIBCXX_USE_CXX11_ABI 1
+#endif
+
+#if _GLIBCXX_USE_CXX11_ABI
+namespace std
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+namespace __gnu_cxx
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+# define _GLIBCXX_NAMESPACE_CXX11 __cxx11::
+# define _GLIBCXX_BEGIN_NAMESPACE_CXX11 namespace __cxx11 {
+# define _GLIBCXX_END_NAMESPACE_CXX11 }
+# define _GLIBCXX_DEFAULT_ABI_TAG _GLIBCXX_ABI_TAG_CXX11
+#else
+# define _GLIBCXX_NAMESPACE_CXX11
+# define _GLIBCXX_BEGIN_NAMESPACE_CXX11
+# define _GLIBCXX_END_NAMESPACE_CXX11
+# define _GLIBCXX_DEFAULT_ABI_TAG
+#endif
+
+
+// Defined if inline namespaces are used for versioning.
+# define _GLIBCXX_INLINE_VERSION 0 
+
+// Inline namespace for symbol versioning.
+#if _GLIBCXX_INLINE_VERSION
+
+namespace std
+{
+  inline namespace __7 { }
+
+  namespace rel_ops { inline namespace __7 { } }
+
+  namespace tr1
+  {
+    inline namespace __7 { }
+    namespace placeholders { inline namespace __7 { } }
+    namespace regex_constants { inline namespace __7 { } }
+    namespace __detail { inline namespace __7 { } }
+  }
+
+  namespace tr2
+  { inline namespace __7 { } }
+
+  namespace decimal { inline namespace __7 { } }
+
+#if __cplusplus >= 201103L
+  namespace chrono { inline namespace __7 { } }
+  namespace placeholders { inline namespace __7 { } }
+  namespace regex_constants { inline namespace __7 { } }
+  namespace this_thread { inline namespace __7 { } }
+
+#if __cplusplus >= 201402L
+  inline namespace literals {
+    inline namespace chrono_literals { inline namespace __7 { } }
+    inline namespace complex_literals { inline namespace __7 { } }
+    inline namespace string_literals { inline namespace __7 { } }
+#if __cplusplus > 201402L
+    inline namespace string_view_literals { inline namespace __7 { } }
+#endif // C++17
+  }
+#endif // C++14
+#endif // C++11
+
+  namespace __detail {
+    inline namespace __7 { }
+#if __cplusplus > 201402L
+    namespace __variant { inline namespace __7 { } }
+#endif
+  }
+}
+
+namespace __gnu_cxx
+{
+  inline namespace __7 { }
+  namespace __detail { inline namespace __7 { } }
+}
+# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __7 {
+# define _GLIBCXX_END_NAMESPACE_VERSION }
+#else
+# define _GLIBCXX_BEGIN_NAMESPACE_VERSION
+# define _GLIBCXX_END_NAMESPACE_VERSION
+#endif
+
+
+// Inline namespaces for special modes: debug, parallel, profile.
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \
+    || defined(_GLIBCXX_PROFILE)
+namespace std
+{
+  // Non-inline namespace for components replaced by alternates in active mode.
+  namespace __cxx1998
+  {
+# if _GLIBCXX_INLINE_VERSION
+  inline namespace __7 { }
+# endif
+
+# if _GLIBCXX_USE_CXX11_ABI
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+# endif
+  }
+
+  // Inline namespace for debug mode.
+# ifdef _GLIBCXX_DEBUG
+  inline namespace __debug { }
+# endif
+
+  // Inline namespaces for parallel mode.
+# ifdef _GLIBCXX_PARALLEL
+  inline namespace __parallel { }
+# endif
+
+  // Inline namespaces for profile mode
+# ifdef _GLIBCXX_PROFILE
+  inline namespace __profile { }
+# endif
+}
+
+// Check for invalid usage and unsupported mixed-mode use.
+# if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL)
+#  error illegal use of multiple inlined namespaces
+# endif
+# if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_DEBUG)
+#  error illegal use of multiple inlined namespaces
+# endif
+# if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_PARALLEL)
+#  error illegal use of multiple inlined namespaces
+# endif
+
+// Check for invalid use due to lack for weak symbols.
+# if __NO_INLINE__ && !__GXX_WEAK__
+#  warning currently using inlined namespace mode which may fail \
+   without inlining due to lack of weak symbols
+# endif
+#endif
+
+// Macros for namespace scope. Either namespace std:: or the name
+// of some nested namespace within it corresponding to the active mode.
+// _GLIBCXX_STD_A
+// _GLIBCXX_STD_C
+//
+// Macros for opening/closing conditional namespaces.
+// _GLIBCXX_BEGIN_NAMESPACE_ALGO
+// _GLIBCXX_END_NAMESPACE_ALGO
+// _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+// _GLIBCXX_END_NAMESPACE_CONTAINER
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE)
+# define _GLIBCXX_STD_C __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
+	 namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION
+# define _GLIBCXX_END_NAMESPACE_CONTAINER \
+	 _GLIBCXX_END_NAMESPACE_VERSION }
+#else
+# define _GLIBCXX_STD_C std
+# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _GLIBCXX_BEGIN_NAMESPACE_VERSION
+# define _GLIBCXX_END_NAMESPACE_CONTAINER _GLIBCXX_END_NAMESPACE_VERSION
+#endif
+
+#ifdef _GLIBCXX_PARALLEL
+# define _GLIBCXX_STD_A __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE_ALGO \
+	 namespace _GLIBCXX_STD_A { _GLIBCXX_BEGIN_NAMESPACE_VERSION
+# define _GLIBCXX_END_NAMESPACE_ALGO \
+	 _GLIBCXX_END_NAMESPACE_VERSION }
+#else
+# define _GLIBCXX_STD_A std
+# define _GLIBCXX_BEGIN_NAMESPACE_ALGO _GLIBCXX_BEGIN_NAMESPACE_VERSION
+# define _GLIBCXX_END_NAMESPACE_ALGO _GLIBCXX_END_NAMESPACE_VERSION
+#endif
+
+// GLIBCXX_ABI Deprecated
+// Define if compatibility should be provided for -mlong-double-64.
+#undef _GLIBCXX_LONG_DOUBLE_COMPAT
+
+// Inline namespace for long double 128 mode.
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+namespace std
+{
+  inline namespace __gnu_cxx_ldbl128 { }
+}
+# define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128::
+# define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 {
+# define _GLIBCXX_END_NAMESPACE_LDBL }
+#else
+# define _GLIBCXX_NAMESPACE_LDBL
+# define _GLIBCXX_BEGIN_NAMESPACE_LDBL
+# define _GLIBCXX_END_NAMESPACE_LDBL
+#endif
+#if _GLIBCXX_USE_CXX11_ABI
+# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_CXX11
+# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11
+# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_CXX11
+#else
+# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_LDBL
+# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL
+# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_LDBL
+#endif
+
+// Debug Mode implies checking assertions.
+#if defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_ASSERTIONS)
+# define _GLIBCXX_ASSERTIONS 1
+#endif
+
+// Disable std::string explicit instantiation declarations in order to assert.
+#ifdef _GLIBCXX_ASSERTIONS
+# undef _GLIBCXX_EXTERN_TEMPLATE
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+#endif
+
+// Assert.
+#if defined(_GLIBCXX_ASSERTIONS) \
+  || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS)
+namespace std
+{
+  // Avoid the use of assert, because we're trying to keep the <cassert>
+  // include out of the mix.
+  inline void
+  __replacement_assert(const char* __file, int __line,
+		       const char* __function, const char* __condition)
+  {
+    __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
+		     __function, __condition);
+    __builtin_abort();
+  }
+}
+#define __glibcxx_assert_impl(_Condition)				 \
+  do 									 \
+  {							      		 \
+    if (! (_Condition))                                                  \
+      std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
+				#_Condition);				 \
+  } while (false)
+#endif
+
+#if defined(_GLIBCXX_ASSERTIONS)
+# define __glibcxx_assert(_Condition) __glibcxx_assert_impl(_Condition)
+#else
+# define __glibcxx_assert(_Condition)
+#endif
+
+// Macros for race detectors.
+// _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and
+// _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain
+// atomic (lock-free) synchronization to race detectors:
+// the race detector will infer a happens-before arc from the former to the
+// latter when they share the same argument pointer.
+//
+// The most frequent use case for these macros (and the only case in the
+// current implementation of the library) is atomic reference counting:
+//   void _M_remove_reference()
+//   {
+//     _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
+//     if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0)
+//       {
+//         _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
+//         _M_destroy(__a);
+//       }
+//   }
+// The annotations in this example tell the race detector that all memory
+// accesses occurred when the refcount was positive do not race with
+// memory accesses which occurred after the refcount became zero.
+#ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE
+# define  _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A)
+#endif
+#ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER
+# define  _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A)
+#endif
+
+// Macros for C linkage: define extern "C" linkage only when using C++.
+# define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
+# define _GLIBCXX_END_EXTERN_C }
+
+# define _GLIBCXX_USE_ALLOCATOR_NEW 1
+
+#else // !__cplusplus
+# define _GLIBCXX_BEGIN_EXTERN_C
+# define _GLIBCXX_END_EXTERN_C
+#endif
+
+
+// First includes.
+
+// Pick up any OS-specific definitions.
+#include <bits/os_defines.h>
+
+// Pick up any CPU-specific definitions.
+#include <bits/cpu_defines.h>
+
+// If platform uses neither visibility nor psuedo-visibility,
+// specify empty default for namespace annotation macros.
+#ifndef _GLIBCXX_PSEUDO_VISIBILITY
+# define _GLIBCXX_PSEUDO_VISIBILITY(V)
+#endif
+
+// Certain function definitions that are meant to be overridable from
+// user code are decorated with this macro.  For some targets, this
+// macro causes these definitions to be weak.
+#ifndef _GLIBCXX_WEAK_DEFINITION
+# define _GLIBCXX_WEAK_DEFINITION
+#endif
+
+// By default, we assume that __GXX_WEAK__ also means that there is support
+// for declaring functions as weak while not defining such functions.  This
+// allows for referring to functions provided by other libraries (e.g.,
+// libitm) without depending on them if the respective features are not used.
+#ifndef _GLIBCXX_USE_WEAK_REF
+# define _GLIBCXX_USE_WEAK_REF __GXX_WEAK__
+#endif
+
+// Conditionally enable annotations for the Transactional Memory TS on C++11.
+// Most of the following conditions are due to limitations in the current
+// implementation.
+#if __cplusplus >= 201103L && _GLIBCXX_USE_CXX11_ABI			\
+  && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L	\
+  &&  !_GLIBCXX_FULLY_DYNAMIC_STRING && _GLIBCXX_USE_WEAK_REF		\
+  && _GLIBCXX_USE_ALLOCATOR_NEW
+#define _GLIBCXX_TXN_SAFE transaction_safe
+#define _GLIBCXX_TXN_SAFE_DYN transaction_safe_dynamic
+#else
+#define _GLIBCXX_TXN_SAFE
+#define _GLIBCXX_TXN_SAFE_DYN
+#endif
+
+#if __cplusplus > 201402L
+// In C++17 mathematical special functions are in namespace std.
+# define _GLIBCXX_USE_STD_SPEC_FUNCS 1
+#elif __cplusplus >= 201103L && __STDCPP_WANT_MATH_SPEC_FUNCS__ != 0
+// For C++11 and C++14 they are in namespace std when requested.
+# define _GLIBCXX_USE_STD_SPEC_FUNCS 1
+#endif
+
+// The remainder of the prewritten config is automatic; all the
+// user hooks are listed above.
+
+// Create a boolean flag to be used to determine if --fast-math is set.
+#ifdef __FAST_MATH__
+# define _GLIBCXX_FAST_MATH 1
+#else
+# define _GLIBCXX_FAST_MATH 0
+#endif
+
+// This marks string literals in header files to be extracted for eventual
+// translation.  It is primarily used for messages in thrown exceptions; see
+// src/functexcept.cc.  We use __N because the more traditional _N is used
+// for something else under certain OSes (see BADNAMES).
+#define __N(msgid)     (msgid)
+
+// For example, <windows.h> is known to #define min and max as macros...
+#undef min
+#undef max
+
+// N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally
+// so they should be tested with #if not with #ifdef.
+#if __cplusplus >= 201103L
+# ifndef _GLIBCXX_USE_C99_MATH
+#  define _GLIBCXX_USE_C99_MATH _GLIBCXX11_USE_C99_MATH
+# endif
+# ifndef _GLIBCXX_USE_C99_COMPLEX
+# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX
+# endif
+# ifndef _GLIBCXX_USE_C99_STDIO
+# define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO
+# endif
+# ifndef _GLIBCXX_USE_C99_STDLIB
+# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB
+# endif
+# ifndef _GLIBCXX_USE_C99_WCHAR
+# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR
+# endif
+#else
+# ifndef _GLIBCXX_USE_C99_MATH
+#  define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH
+# endif
+# ifndef _GLIBCXX_USE_C99_COMPLEX
+# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX
+# endif
+# ifndef _GLIBCXX_USE_C99_STDIO
+# define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO
+# endif
+# ifndef _GLIBCXX_USE_C99_STDLIB
+# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB
+# endif
+# ifndef _GLIBCXX_USE_C99_WCHAR
+# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR
+# endif
+#endif
+
+/* Define if __float128 is supported on this host. */
+#if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
+#undef _GLIBCXX_USE_FLOAT128
+#endif
+
+// End of prewritten config; the settings discovered at configure time follow.
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `acosf' function. */
+#define _GLIBCXX_HAVE_ACOSF 1
+
+/* Define to 1 if you have the `acosl' function. */
+#define _GLIBCXX_HAVE_ACOSL 1
+
+/* Define to 1 if you have the `aligned_alloc' function. */
+#define _GLIBCXX_HAVE_ALIGNED_ALLOC 1
+
+/* Define to 1 if you have the `asinf' function. */
+#define _GLIBCXX_HAVE_ASINF 1
+
+/* Define to 1 if you have the `asinl' function. */
+#define _GLIBCXX_HAVE_ASINL 1
+
+/* Define to 1 if the target assembler supports .symver directive. */
+#define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1
+
+/* Define to 1 if you have the `atan2f' function. */
+#define _GLIBCXX_HAVE_ATAN2F 1
+
+/* Define to 1 if you have the `atan2l' function. */
+#define _GLIBCXX_HAVE_ATAN2L 1
+
+/* Define to 1 if you have the `atanf' function. */
+#define _GLIBCXX_HAVE_ATANF 1
+
+/* Define to 1 if you have the `atanl' function. */
+#define _GLIBCXX_HAVE_ATANL 1
+
+/* Define to 1 if you have the `at_quick_exit' function. */
+#define _GLIBCXX_HAVE_AT_QUICK_EXIT 1
+
+/* Define to 1 if the target assembler supports thread-local storage. */
+/* #undef _GLIBCXX_HAVE_CC_TLS */
+
+/* Define to 1 if you have the `ceilf' function. */
+#define _GLIBCXX_HAVE_CEILF 1
+
+/* Define to 1 if you have the `ceill' function. */
+#define _GLIBCXX_HAVE_CEILL 1
+
+/* Define to 1 if you have the <complex.h> header file. */
+#define _GLIBCXX_HAVE_COMPLEX_H 1
+
+/* Define to 1 if you have the `cosf' function. */
+#define _GLIBCXX_HAVE_COSF 1
+
+/* Define to 1 if you have the `coshf' function. */
+#define _GLIBCXX_HAVE_COSHF 1
+
+/* Define to 1 if you have the `coshl' function. */
+#define _GLIBCXX_HAVE_COSHL 1
+
+/* Define to 1 if you have the `cosl' function. */
+#define _GLIBCXX_HAVE_COSL 1
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#define _GLIBCXX_HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define _GLIBCXX_HAVE_DLFCN_H 1
+
+/* Define if EBADMSG exists. */
+#define _GLIBCXX_HAVE_EBADMSG 1
+
+/* Define if ECANCELED exists. */
+#define _GLIBCXX_HAVE_ECANCELED 1
+
+/* Define if ECHILD exists. */
+#define _GLIBCXX_HAVE_ECHILD 1
+
+/* Define if EIDRM exists. */
+#define _GLIBCXX_HAVE_EIDRM 1
+
+/* Define to 1 if you have the <endian.h> header file. */
+#define _GLIBCXX_HAVE_ENDIAN_H 1
+
+/* Define if ENODATA exists. */
+#define _GLIBCXX_HAVE_ENODATA 1
+
+/* Define if ENOLINK exists. */
+#define _GLIBCXX_HAVE_ENOLINK 1
+
+/* Define if ENOSPC exists. */
+#define _GLIBCXX_HAVE_ENOSPC 1
+
+/* Define if ENOSR exists. */
+#define _GLIBCXX_HAVE_ENOSR 1
+
+/* Define if ENOSTR exists. */
+#define _GLIBCXX_HAVE_ENOSTR 1
+
+/* Define if ENOTRECOVERABLE exists. */
+#define _GLIBCXX_HAVE_ENOTRECOVERABLE 1
+
+/* Define if ENOTSUP exists. */
+#define _GLIBCXX_HAVE_ENOTSUP 1
+
+/* Define if EOVERFLOW exists. */
+#define _GLIBCXX_HAVE_EOVERFLOW 1
+
+/* Define if EOWNERDEAD exists. */
+#define _GLIBCXX_HAVE_EOWNERDEAD 1
+
+/* Define if EPERM exists. */
+#define _GLIBCXX_HAVE_EPERM 1
+
+/* Define if EPROTO exists. */
+#define _GLIBCXX_HAVE_EPROTO 1
+
+/* Define if ETIME exists. */
+#define _GLIBCXX_HAVE_ETIME 1
+
+/* Define if ETIMEDOUT exists. */
+#define _GLIBCXX_HAVE_ETIMEDOUT 1
+
+/* Define if ETXTBSY exists. */
+#define _GLIBCXX_HAVE_ETXTBSY 1
+
+/* Define if EWOULDBLOCK exists. */
+#define _GLIBCXX_HAVE_EWOULDBLOCK 1
+
+/* Define to 1 if GCC 4.6 supported std::exception_ptr for the target */
+#define _GLIBCXX_HAVE_EXCEPTION_PTR_SINCE_GCC46 1
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#define _GLIBCXX_HAVE_EXECINFO_H 1
+
+/* Define to 1 if you have the `expf' function. */
+#define _GLIBCXX_HAVE_EXPF 1
+
+/* Define to 1 if you have the `expl' function. */
+#define _GLIBCXX_HAVE_EXPL 1
+
+/* Define to 1 if you have the `fabsf' function. */
+#define _GLIBCXX_HAVE_FABSF 1
+
+/* Define to 1 if you have the `fabsl' function. */
+#define _GLIBCXX_HAVE_FABSL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define _GLIBCXX_HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <fenv.h> header file. */
+#define _GLIBCXX_HAVE_FENV_H 1
+
+/* Define to 1 if you have the `finite' function. */
+#define _GLIBCXX_HAVE_FINITE 1
+
+/* Define to 1 if you have the `finitef' function. */
+#define _GLIBCXX_HAVE_FINITEF 1
+
+/* Define to 1 if you have the `finitel' function. */
+#define _GLIBCXX_HAVE_FINITEL 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#define _GLIBCXX_HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `floorf' function. */
+#define _GLIBCXX_HAVE_FLOORF 1
+
+/* Define to 1 if you have the `floorl' function. */
+#define _GLIBCXX_HAVE_FLOORL 1
+
+/* Define to 1 if you have the `fmodf' function. */
+#define _GLIBCXX_HAVE_FMODF 1
+
+/* Define to 1 if you have the `fmodl' function. */
+#define _GLIBCXX_HAVE_FMODL 1
+
+/* Define to 1 if you have the `fpclass' function. */
+/* #undef _GLIBCXX_HAVE_FPCLASS */
+
+/* Define to 1 if you have the <fp.h> header file. */
+/* #undef _GLIBCXX_HAVE_FP_H */
+
+/* Define to 1 if you have the `frexpf' function. */
+#define _GLIBCXX_HAVE_FREXPF 1
+
+/* Define to 1 if you have the `frexpl' function. */
+#define _GLIBCXX_HAVE_FREXPL 1
+
+/* Define if _Unwind_GetIPInfo is available. */
+#define _GLIBCXX_HAVE_GETIPINFO 1
+
+/* Define if gets is available in <stdio.h> before C++14. */
+#define _GLIBCXX_HAVE_GETS 1
+
+/* Define to 1 if you have the `hypot' function. */
+#define _GLIBCXX_HAVE_HYPOT 1
+
+/* Define to 1 if you have the `hypotf' function. */
+#define _GLIBCXX_HAVE_HYPOTF 1
+
+/* Define to 1 if you have the `hypotl' function. */
+#define _GLIBCXX_HAVE_HYPOTL 1
+
+/* Define if you have the iconv() function. */
+#define _GLIBCXX_HAVE_ICONV 1
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+/* #undef _GLIBCXX_HAVE_IEEEFP_H */
+
+/* Define if int64_t is available in <stdint.h>. */
+#define _GLIBCXX_HAVE_INT64_T 1
+
+/* Define if int64_t is a long. */
+/* #undef _GLIBCXX_HAVE_INT64_T_LONG */
+
+/* Define if int64_t is a long long. */
+#define _GLIBCXX_HAVE_INT64_T_LONG_LONG 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define _GLIBCXX_HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isinf' function. */
+/* #undef _GLIBCXX_HAVE_ISINF */
+
+/* Define to 1 if you have the `isinff' function. */
+#define _GLIBCXX_HAVE_ISINFF 1
+
+/* Define to 1 if you have the `isinfl' function. */
+#define _GLIBCXX_HAVE_ISINFL 1
+
+/* Define to 1 if you have the `isnan' function. */
+/* #undef _GLIBCXX_HAVE_ISNAN */
+
+/* Define to 1 if you have the `isnanf' function. */
+#define _GLIBCXX_HAVE_ISNANF 1
+
+/* Define to 1 if you have the `isnanl' function. */
+#define _GLIBCXX_HAVE_ISNANL 1
+
+/* Defined if iswblank exists. */
+#define _GLIBCXX_HAVE_ISWBLANK 1
+
+/* Define if LC_MESSAGES is available in <locale.h>. */
+#define _GLIBCXX_HAVE_LC_MESSAGES 1
+
+/* Define to 1 if you have the `ldexpf' function. */
+#define _GLIBCXX_HAVE_LDEXPF 1
+
+/* Define to 1 if you have the `ldexpl' function. */
+#define _GLIBCXX_HAVE_LDEXPL 1
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#define _GLIBCXX_HAVE_LIBINTL_H 1
+
+/* Only used in build directory testsuite_hooks.h. */
+#define _GLIBCXX_HAVE_LIMIT_AS 1
+
+/* Only used in build directory testsuite_hooks.h. */
+#define _GLIBCXX_HAVE_LIMIT_DATA 1
+
+/* Only used in build directory testsuite_hooks.h. */
+#define _GLIBCXX_HAVE_LIMIT_FSIZE 1
+
+/* Only used in build directory testsuite_hooks.h. */
+#define _GLIBCXX_HAVE_LIMIT_RSS 1
+
+/* Only used in build directory testsuite_hooks.h. */
+#define _GLIBCXX_HAVE_LIMIT_VMEM 0
+
+/* Define if futex syscall is available. */
+#define _GLIBCXX_HAVE_LINUX_FUTEX 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define _GLIBCXX_HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `log10f' function. */
+#define _GLIBCXX_HAVE_LOG10F 1
+
+/* Define to 1 if you have the `log10l' function. */
+#define _GLIBCXX_HAVE_LOG10L 1
+
+/* Define to 1 if you have the `logf' function. */
+#define _GLIBCXX_HAVE_LOGF 1
+
+/* Define to 1 if you have the `logl' function. */
+#define _GLIBCXX_HAVE_LOGL 1
+
+/* Define to 1 if you have the <machine/endian.h> header file. */
+/* #undef _GLIBCXX_HAVE_MACHINE_ENDIAN_H */
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+/* #undef _GLIBCXX_HAVE_MACHINE_PARAM_H */
+
+/* Define if mbstate_t exists in wchar.h. */
+#define _GLIBCXX_HAVE_MBSTATE_T 1
+
+/* Define to 1 if you have the `memalign' function. */
+#define _GLIBCXX_HAVE_MEMALIGN 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define _GLIBCXX_HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `modf' function. */
+#define _GLIBCXX_HAVE_MODF 1
+
+/* Define to 1 if you have the `modff' function. */
+#define _GLIBCXX_HAVE_MODFF 1
+
+/* Define to 1 if you have the `modfl' function. */
+#define _GLIBCXX_HAVE_MODFL 1
+
+/* Define to 1 if you have the <nan.h> header file. */
+/* #undef _GLIBCXX_HAVE_NAN_H */
+
+/* Define if <math.h> defines obsolete isinf function. */
+/* #undef _GLIBCXX_HAVE_OBSOLETE_ISINF */
+
+/* Define if <math.h> defines obsolete isnan function. */
+/* #undef _GLIBCXX_HAVE_OBSOLETE_ISNAN */
+
+/* Define if poll is available in <poll.h>. */
+#define _GLIBCXX_HAVE_POLL 1
+
+/* Define to 1 if you have the `posix_memalign' function. */
+#define _GLIBCXX_HAVE_POSIX_MEMALIGN 1
+
+/* Define to 1 if you have the `powf' function. */
+#define _GLIBCXX_HAVE_POWF 1
+
+/* Define to 1 if you have the `powl' function. */
+#define _GLIBCXX_HAVE_POWL 1
+
+/* Define to 1 if you have the `qfpclass' function. */
+/* #undef _GLIBCXX_HAVE_QFPCLASS */
+
+/* Define to 1 if you have the `quick_exit' function. */
+#define _GLIBCXX_HAVE_QUICK_EXIT 1
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef _GLIBCXX_HAVE_SETENV */
+
+/* Define to 1 if you have the `sincos' function. */
+#define _GLIBCXX_HAVE_SINCOS 1
+
+/* Define to 1 if you have the `sincosf' function. */
+#define _GLIBCXX_HAVE_SINCOSF 1
+
+/* Define to 1 if you have the `sincosl' function. */
+#define _GLIBCXX_HAVE_SINCOSL 1
+
+/* Define to 1 if you have the `sinf' function. */
+#define _GLIBCXX_HAVE_SINF 1
+
+/* Define to 1 if you have the `sinhf' function. */
+#define _GLIBCXX_HAVE_SINHF 1
+
+/* Define to 1 if you have the `sinhl' function. */
+#define _GLIBCXX_HAVE_SINHL 1
+
+/* Define to 1 if you have the `sinl' function. */
+#define _GLIBCXX_HAVE_SINL 1
+
+/* Defined if sleep exists. */
+/* #undef _GLIBCXX_HAVE_SLEEP */
+
+/* Define to 1 if you have the `sqrtf' function. */
+#define _GLIBCXX_HAVE_SQRTF 1
+
+/* Define to 1 if you have the `sqrtl' function. */
+#define _GLIBCXX_HAVE_SQRTL 1
+
+/* Define to 1 if you have the <stdalign.h> header file. */
+#define _GLIBCXX_HAVE_STDALIGN_H 1
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define _GLIBCXX_HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define _GLIBCXX_HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _GLIBCXX_HAVE_STDLIB_H 1
+
+/* Define if strerror_l is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRERROR_L 1
+
+/* Define if strerror_r is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _GLIBCXX_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _GLIBCXX_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtof' function. */
+#define _GLIBCXX_HAVE_STRTOF 1
+
+/* Define to 1 if you have the `strtold' function. */
+#define _GLIBCXX_HAVE_STRTOLD 1
+
+/* Define to 1 if `d_type' is a member of `struct dirent'. */
+#define _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE 1
+
+/* Define if strxfrm_l is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRXFRM_L 1
+
+/* Define to 1 if the target runtime linker supports binding the same symbol
+   to different versions. */
+#define _GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_FILIO_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define _GLIBCXX_HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/ipc.h> header file. */
+#define _GLIBCXX_HAVE_SYS_IPC_H 1
+
+/* Define to 1 if you have the <sys/isa_defs.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_ISA_DEFS_H */
+
+/* Define to 1 if you have the <sys/machine.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_MACHINE_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define _GLIBCXX_HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define _GLIBCXX_HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have a suitable <sys/sdt.h> header file */
+/* #undef _GLIBCXX_HAVE_SYS_SDT_H */
+
+/* Define to 1 if you have the <sys/sem.h> header file. */
+#define _GLIBCXX_HAVE_SYS_SEM_H 1
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+#define _GLIBCXX_HAVE_SYS_STATVFS_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _GLIBCXX_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/sysinfo.h> header file. */
+#define _GLIBCXX_HAVE_SYS_SYSINFO_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define _GLIBCXX_HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define _GLIBCXX_HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define _GLIBCXX_HAVE_SYS_UIO_H 1
+
+/* Define if S_IFREG is available in <sys/stat.h>. */
+/* #undef _GLIBCXX_HAVE_S_IFREG */
+
+/* Define if S_ISREG is available in <sys/stat.h>. */
+#define _GLIBCXX_HAVE_S_ISREG 1
+
+/* Define to 1 if you have the `tanf' function. */
+#define _GLIBCXX_HAVE_TANF 1
+
+/* Define to 1 if you have the `tanhf' function. */
+#define _GLIBCXX_HAVE_TANHF 1
+
+/* Define to 1 if you have the `tanhl' function. */
+#define _GLIBCXX_HAVE_TANHL 1
+
+/* Define to 1 if you have the `tanl' function. */
+#define _GLIBCXX_HAVE_TANL 1
+
+/* Define to 1 if you have the <tgmath.h> header file. */
+#define _GLIBCXX_HAVE_TGMATH_H 1
+
+/* Define to 1 if the target supports thread-local storage. */
+#define _GLIBCXX_HAVE_TLS 1
+
+/* Define to 1 if you have the <uchar.h> header file. */
+#define _GLIBCXX_HAVE_UCHAR_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define _GLIBCXX_HAVE_UNISTD_H 1
+
+/* Defined if usleep exists. */
+/* #undef _GLIBCXX_HAVE_USLEEP */
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define _GLIBCXX_HAVE_UTIME_H 1
+
+/* Defined if vfwscanf exists. */
+#define _GLIBCXX_HAVE_VFWSCANF 1
+
+/* Defined if vswscanf exists. */
+#define _GLIBCXX_HAVE_VSWSCANF 1
+
+/* Defined if vwscanf exists. */
+#define _GLIBCXX_HAVE_VWSCANF 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define _GLIBCXX_HAVE_WCHAR_H 1
+
+/* Defined if wcstof exists. */
+#define _GLIBCXX_HAVE_WCSTOF 1
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#define _GLIBCXX_HAVE_WCTYPE_H 1
+
+/* Defined if Sleep exists. */
+/* #undef _GLIBCXX_HAVE_WIN32_SLEEP */
+
+/* Define if writev is available in <sys/uio.h>. */
+#define _GLIBCXX_HAVE_WRITEV 1
+
+/* Define to 1 if you have the `_acosf' function. */
+/* #undef _GLIBCXX_HAVE__ACOSF */
+
+/* Define to 1 if you have the `_acosl' function. */
+/* #undef _GLIBCXX_HAVE__ACOSL */
+
+/* Define to 1 if you have the `_aligned_malloc' function. */
+/* #undef _GLIBCXX_HAVE__ALIGNED_MALLOC */
+
+/* Define to 1 if you have the `_asinf' function. */
+/* #undef _GLIBCXX_HAVE__ASINF */
+
+/* Define to 1 if you have the `_asinl' function. */
+/* #undef _GLIBCXX_HAVE__ASINL */
+
+/* Define to 1 if you have the `_atan2f' function. */
+/* #undef _GLIBCXX_HAVE__ATAN2F */
+
+/* Define to 1 if you have the `_atan2l' function. */
+/* #undef _GLIBCXX_HAVE__ATAN2L */
+
+/* Define to 1 if you have the `_atanf' function. */
+/* #undef _GLIBCXX_HAVE__ATANF */
+
+/* Define to 1 if you have the `_atanl' function. */
+/* #undef _GLIBCXX_HAVE__ATANL */
+
+/* Define to 1 if you have the `_ceilf' function. */
+/* #undef _GLIBCXX_HAVE__CEILF */
+
+/* Define to 1 if you have the `_ceill' function. */
+/* #undef _GLIBCXX_HAVE__CEILL */
+
+/* Define to 1 if you have the `_cosf' function. */
+/* #undef _GLIBCXX_HAVE__COSF */
+
+/* Define to 1 if you have the `_coshf' function. */
+/* #undef _GLIBCXX_HAVE__COSHF */
+
+/* Define to 1 if you have the `_coshl' function. */
+/* #undef _GLIBCXX_HAVE__COSHL */
+
+/* Define to 1 if you have the `_cosl' function. */
+/* #undef _GLIBCXX_HAVE__COSL */
+
+/* Define to 1 if you have the `_expf' function. */
+/* #undef _GLIBCXX_HAVE__EXPF */
+
+/* Define to 1 if you have the `_expl' function. */
+/* #undef _GLIBCXX_HAVE__EXPL */
+
+/* Define to 1 if you have the `_fabsf' function. */
+/* #undef _GLIBCXX_HAVE__FABSF */
+
+/* Define to 1 if you have the `_fabsl' function. */
+/* #undef _GLIBCXX_HAVE__FABSL */
+
+/* Define to 1 if you have the `_finite' function. */
+/* #undef _GLIBCXX_HAVE__FINITE */
+
+/* Define to 1 if you have the `_finitef' function. */
+/* #undef _GLIBCXX_HAVE__FINITEF */
+
+/* Define to 1 if you have the `_finitel' function. */
+/* #undef _GLIBCXX_HAVE__FINITEL */
+
+/* Define to 1 if you have the `_floorf' function. */
+/* #undef _GLIBCXX_HAVE__FLOORF */
+
+/* Define to 1 if you have the `_floorl' function. */
+/* #undef _GLIBCXX_HAVE__FLOORL */
+
+/* Define to 1 if you have the `_fmodf' function. */
+/* #undef _GLIBCXX_HAVE__FMODF */
+
+/* Define to 1 if you have the `_fmodl' function. */
+/* #undef _GLIBCXX_HAVE__FMODL */
+
+/* Define to 1 if you have the `_fpclass' function. */
+/* #undef _GLIBCXX_HAVE__FPCLASS */
+
+/* Define to 1 if you have the `_frexpf' function. */
+/* #undef _GLIBCXX_HAVE__FREXPF */
+
+/* Define to 1 if you have the `_frexpl' function. */
+/* #undef _GLIBCXX_HAVE__FREXPL */
+
+/* Define to 1 if you have the `_hypot' function. */
+/* #undef _GLIBCXX_HAVE__HYPOT */
+
+/* Define to 1 if you have the `_hypotf' function. */
+/* #undef _GLIBCXX_HAVE__HYPOTF */
+
+/* Define to 1 if you have the `_hypotl' function. */
+/* #undef _GLIBCXX_HAVE__HYPOTL */
+
+/* Define to 1 if you have the `_isinf' function. */
+/* #undef _GLIBCXX_HAVE__ISINF */
+
+/* Define to 1 if you have the `_isinff' function. */
+/* #undef _GLIBCXX_HAVE__ISINFF */
+
+/* Define to 1 if you have the `_isinfl' function. */
+/* #undef _GLIBCXX_HAVE__ISINFL */
+
+/* Define to 1 if you have the `_isnan' function. */
+/* #undef _GLIBCXX_HAVE__ISNAN */
+
+/* Define to 1 if you have the `_isnanf' function. */
+/* #undef _GLIBCXX_HAVE__ISNANF */
+
+/* Define to 1 if you have the `_isnanl' function. */
+/* #undef _GLIBCXX_HAVE__ISNANL */
+
+/* Define to 1 if you have the `_ldexpf' function. */
+/* #undef _GLIBCXX_HAVE__LDEXPF */
+
+/* Define to 1 if you have the `_ldexpl' function. */
+/* #undef _GLIBCXX_HAVE__LDEXPL */
+
+/* Define to 1 if you have the `_log10f' function. */
+/* #undef _GLIBCXX_HAVE__LOG10F */
+
+/* Define to 1 if you have the `_log10l' function. */
+/* #undef _GLIBCXX_HAVE__LOG10L */
+
+/* Define to 1 if you have the `_logf' function. */
+/* #undef _GLIBCXX_HAVE__LOGF */
+
+/* Define to 1 if you have the `_logl' function. */
+/* #undef _GLIBCXX_HAVE__LOGL */
+
+/* Define to 1 if you have the `_modf' function. */
+/* #undef _GLIBCXX_HAVE__MODF */
+
+/* Define to 1 if you have the `_modff' function. */
+/* #undef _GLIBCXX_HAVE__MODFF */
+
+/* Define to 1 if you have the `_modfl' function. */
+/* #undef _GLIBCXX_HAVE__MODFL */
+
+/* Define to 1 if you have the `_powf' function. */
+/* #undef _GLIBCXX_HAVE__POWF */
+
+/* Define to 1 if you have the `_powl' function. */
+/* #undef _GLIBCXX_HAVE__POWL */
+
+/* Define to 1 if you have the `_qfpclass' function. */
+/* #undef _GLIBCXX_HAVE__QFPCLASS */
+
+/* Define to 1 if you have the `_sincos' function. */
+/* #undef _GLIBCXX_HAVE__SINCOS */
+
+/* Define to 1 if you have the `_sincosf' function. */
+/* #undef _GLIBCXX_HAVE__SINCOSF */
+
+/* Define to 1 if you have the `_sincosl' function. */
+/* #undef _GLIBCXX_HAVE__SINCOSL */
+
+/* Define to 1 if you have the `_sinf' function. */
+/* #undef _GLIBCXX_HAVE__SINF */
+
+/* Define to 1 if you have the `_sinhf' function. */
+/* #undef _GLIBCXX_HAVE__SINHF */
+
+/* Define to 1 if you have the `_sinhl' function. */
+/* #undef _GLIBCXX_HAVE__SINHL */
+
+/* Define to 1 if you have the `_sinl' function. */
+/* #undef _GLIBCXX_HAVE__SINL */
+
+/* Define to 1 if you have the `_sqrtf' function. */
+/* #undef _GLIBCXX_HAVE__SQRTF */
+
+/* Define to 1 if you have the `_sqrtl' function. */
+/* #undef _GLIBCXX_HAVE__SQRTL */
+
+/* Define to 1 if you have the `_tanf' function. */
+/* #undef _GLIBCXX_HAVE__TANF */
+
+/* Define to 1 if you have the `_tanhf' function. */
+/* #undef _GLIBCXX_HAVE__TANHF */
+
+/* Define to 1 if you have the `_tanhl' function. */
+/* #undef _GLIBCXX_HAVE__TANHL */
+
+/* Define to 1 if you have the `_tanl' function. */
+/* #undef _GLIBCXX_HAVE__TANL */
+
+/* Define to 1 if you have the `__cxa_thread_atexit' function. */
+/* #undef _GLIBCXX_HAVE___CXA_THREAD_ATEXIT */
+
+/* Define to 1 if you have the `__cxa_thread_atexit_impl' function. */
+#define _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL 1
+
+/* Define as const if the declaration of iconv() needs const. */
+#define _GLIBCXX_ICONV_CONST 
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+/* #undef _GLIBCXX_PACKAGE */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _GLIBCXX_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _GLIBCXX_PACKAGE_NAME "package-unused"
+
+/* Define to the full name and version of this package. */
+#define _GLIBCXX_PACKAGE_STRING "package-unused version-unused"
+
+/* Define to the one symbol short name of this package. */
+#define _GLIBCXX_PACKAGE_TARNAME "libstdc++"
+
+/* Define to the home page for this package. */
+#define _GLIBCXX_PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused"
+
+/* The size of `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of `void *', as computed by sizeof. */
+/* #undef SIZEOF_VOID_P */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+/* #undef _GLIBCXX_VERSION */
+
+/* Define if C99 functions in <complex.h> should be used in <complex> for
+   C++11. Using compiler builtins for these functions requires corresponding
+   C99 library functions to be present. */
+#define _GLIBCXX11_USE_C99_COMPLEX 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
+   in namespace std for C++11. */
+#define _GLIBCXX11_USE_C99_MATH 1
+
+/* Define if C99 functions or macros in <stdio.h> should be imported in
+   <cstdio> in namespace std for C++11. */
+#define _GLIBCXX11_USE_C99_STDIO 1
+
+/* Define if C99 functions or macros in <stdlib.h> should be imported in
+   <cstdlib> in namespace std for C++11. */
+#define _GLIBCXX11_USE_C99_STDLIB 1
+
+/* Define if C99 functions or macros in <wchar.h> should be imported in
+   <cwchar> in namespace std for C++11. */
+#define _GLIBCXX11_USE_C99_WCHAR 1
+
+/* Define if C99 functions in <complex.h> should be used in <complex> for
+   C++98. Using compiler builtins for these functions requires corresponding
+   C99 library functions to be present. */
+#define _GLIBCXX98_USE_C99_COMPLEX 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
+   in namespace std for C++98. */
+#define _GLIBCXX98_USE_C99_MATH 1
+
+/* Define if C99 functions or macros in <stdio.h> should be imported in
+   <cstdio> in namespace std for C++98. */
+#define _GLIBCXX98_USE_C99_STDIO 1
+
+/* Define if C99 functions or macros in <stdlib.h> should be imported in
+   <cstdlib> in namespace std for C++98. */
+#define _GLIBCXX98_USE_C99_STDLIB 1
+
+/* Define if C99 functions or macros in <wchar.h> should be imported in
+   <cwchar> in namespace std for C++98. */
+#define _GLIBCXX98_USE_C99_WCHAR 1
+
+/* Define if the compiler supports C++11 atomics. */
+#define _GLIBCXX_ATOMIC_BUILTINS 1
+
+/* Define to use concept checking code from the boost libraries. */
+/* #undef _GLIBCXX_CONCEPT_CHECKS */
+
+/* Define to 1 if a fully dynamic basic_string is wanted, 0 to disable,
+   undefined for platform defaults */
+#define _GLIBCXX_FULLY_DYNAMIC_STRING 0
+
+/* Define if gthreads library is available. */
+#define _GLIBCXX_HAS_GTHREADS 1
+
+/* Define to 1 if a full hosted library is built, or 0 if freestanding. */
+#define _GLIBCXX_HOSTED 1
+
+/* Define if compatibility should be provided for -mlong-double-64. */
+
+/* Define to the letter to which size_t is mangled. */
+#define _GLIBCXX_MANGLE_SIZE_T j
+
+/* Define if C99 llrint and llround functions are missing from <math.h>. */
+/* #undef _GLIBCXX_NO_C99_ROUNDING_FUNCS */
+
+/* Define if ptrdiff_t is int. */
+#define _GLIBCXX_PTRDIFF_T_IS_INT 1
+
+/* Define if using setrlimit to set resource limits during "make check" */
+#define _GLIBCXX_RES_LIMITS 1
+
+/* Define if size_t is unsigned int. */
+#define _GLIBCXX_SIZE_T_IS_UINT 1
+
+/* Define to the value of the EOF integer constant. */
+#define _GLIBCXX_STDIO_EOF -1
+
+/* Define to the value of the SEEK_CUR integer constant. */
+#define _GLIBCXX_STDIO_SEEK_CUR 1
+
+/* Define to the value of the SEEK_END integer constant. */
+#define _GLIBCXX_STDIO_SEEK_END 2
+
+/* Define to use symbol versioning in the shared library. */
+#define _GLIBCXX_SYMVER 1
+
+/* Define to use darwin versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_DARWIN */
+
+/* Define to use GNU versioning in the shared library. */
+#define _GLIBCXX_SYMVER_GNU 1
+
+/* Define to use GNU namespace versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_GNU_NAMESPACE */
+
+/* Define to use Sun versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_SUN */
+
+/* Define if C11 functions in <uchar.h> should be imported into namespace std
+   in <cuchar>. */
+#define _GLIBCXX_USE_C11_UCHAR_CXX11 1
+
+/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
+   <stdio.h>, and <stdlib.h> can be used or exposed. */
+#define _GLIBCXX_USE_C99 1
+
+/* Define if C99 functions in <complex.h> should be used in <tr1/complex>.
+   Using compiler builtins for these functions requires corresponding C99
+   library functions to be present. */
+#define _GLIBCXX_USE_C99_COMPLEX_TR1 1
+
+/* Define if C99 functions in <ctype.h> should be imported in <tr1/cctype> in
+   namespace std::tr1. */
+#define _GLIBCXX_USE_C99_CTYPE_TR1 1
+
+/* Define if C99 functions in <fenv.h> should be imported in <tr1/cfenv> in
+   namespace std::tr1. */
+#define _GLIBCXX_USE_C99_FENV_TR1 1
+
+/* Define if C99 functions in <inttypes.h> should be imported in
+   <tr1/cinttypes> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_INTTYPES_TR1 1
+
+/* Define if wchar_t C99 functions in <inttypes.h> should be imported in
+   <tr1/cinttypes> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in
+   <tr1/cmath> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_MATH_TR1 1
+
+/* Define if C99 types in <stdint.h> should be imported in <tr1/cstdint> in
+   namespace std::tr1. */
+#define _GLIBCXX_USE_C99_STDINT_TR1 1
+
+/* Defined if clock_gettime syscall has monotonic and realtime clock support.
+   */
+/* #undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL */
+
+/* Defined if clock_gettime has monotonic clock support. */
+#define _GLIBCXX_USE_CLOCK_MONOTONIC 1
+
+/* Defined if clock_gettime has realtime clock support. */
+#define _GLIBCXX_USE_CLOCK_REALTIME 1
+
+/* Define if ISO/IEC TR 24733 decimal floating point types are supported on
+   this host. */
+/* #undef _GLIBCXX_USE_DECIMAL_FLOAT */
+
+/* Define if fchmod is available in <sys/stat.h>. */
+#define _GLIBCXX_USE_FCHMOD 1
+
+/* Define if fchmodat is available in <sys/stat.h>. */
+#define _GLIBCXX_USE_FCHMODAT 1
+
+/* Defined if gettimeofday is available. */
+#define _GLIBCXX_USE_GETTIMEOFDAY 1
+
+/* Define if get_nprocs is available in <sys/sysinfo.h>. */
+#define _GLIBCXX_USE_GET_NPROCS 1
+
+/* Define if __int128 is supported on this host. */
+/* #undef _GLIBCXX_USE_INT128 */
+
+/* Define if LFS support is available. */
+#define _GLIBCXX_USE_LFS 1
+
+/* Define if code specialized for long long should be used. */
+#define _GLIBCXX_USE_LONG_LONG 1
+
+/* Defined if nanosleep is available. */
+#define _GLIBCXX_USE_NANOSLEEP 1
+
+/* Define if NLS translations are to be used. */
+#define _GLIBCXX_USE_NLS 1
+
+/* Define if pthreads_num_processors_np is available in <pthread.h>. */
+/* #undef _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP */
+
+/* Define if POSIX read/write locks are available in <gthr.h>. */
+#define _GLIBCXX_USE_PTHREAD_RWLOCK_T 1
+
+/* Define if /dev/random and /dev/urandom are available for the random_device
+   of TR1 (Chapter 5.1). */
+#define _GLIBCXX_USE_RANDOM_TR1 1
+
+/* Define if usable realpath is available in <stdlib.h>. */
+#define _GLIBCXX_USE_REALPATH 1
+
+/* Defined if sched_yield is available. */
+#define _GLIBCXX_USE_SCHED_YIELD 1
+
+/* Define if _SC_NPROCESSORS_ONLN is available in <unistd.h>. */
+#define _GLIBCXX_USE_SC_NPROCESSORS_ONLN 1
+
+/* Define if _SC_NPROC_ONLN is available in <unistd.h>. */
+/* #undef _GLIBCXX_USE_SC_NPROC_ONLN */
+
+/* Define if sendfile is available in <sys/sendfile.h>. */
+#define _GLIBCXX_USE_SENDFILE 1
+
+/* Define if struct stat has timespec members. */
+#define _GLIBCXX_USE_ST_MTIM 1
+
+/* Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>. */
+/* #undef _GLIBCXX_USE_SYSCTL_HW_NCPU */
+
+/* Define if obsolescent tmpnam is available in <stdio.h>. */
+#define _GLIBCXX_USE_TMPNAM 1
+
+/* Define if utimensat and UTIME_OMIT are available in <sys/stat.h> and
+   AT_FDCWD in <fcntl.h>. */
+#define _GLIBCXX_USE_UTIMENSAT 1
+
+/* Define if code specialized for wchar_t should be used. */
+#define _GLIBCXX_USE_WCHAR_T 1
+
+/* Define to 1 if a verbose library is built, or 0 otherwise. */
+#define _GLIBCXX_VERBOSE 1
+
+/* Defined if as can handle rdrand. */
+/* #undef _GLIBCXX_X86_RDRAND */
+
+/* Define to 1 if mutex_timedlock is available. */
+#define _GTHREAD_USE_MUTEX_TIMEDLOCK 1
+
+/* Define if all C++11 floating point overloads are available in <math.h>.  */
+#if __cplusplus >= 201103L
+/* #undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP */
+#endif
+
+/* Define if all C++11 integral type overloads are available in <math.h>.  */
+#if __cplusplus >= 201103L
+/* #undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT */
+#endif
+
+#if defined (_GLIBCXX_HAVE__ACOSF) && ! defined (_GLIBCXX_HAVE_ACOSF)
+# define _GLIBCXX_HAVE_ACOSF 1
+# define acosf _acosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ACOSL) && ! defined (_GLIBCXX_HAVE_ACOSL)
+# define _GLIBCXX_HAVE_ACOSL 1
+# define acosl _acosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ASINF) && ! defined (_GLIBCXX_HAVE_ASINF)
+# define _GLIBCXX_HAVE_ASINF 1
+# define asinf _asinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ASINL) && ! defined (_GLIBCXX_HAVE_ASINL)
+# define _GLIBCXX_HAVE_ASINL 1
+# define asinl _asinl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATAN2F) && ! defined (_GLIBCXX_HAVE_ATAN2F)
+# define _GLIBCXX_HAVE_ATAN2F 1
+# define atan2f _atan2f
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATAN2L) && ! defined (_GLIBCXX_HAVE_ATAN2L)
+# define _GLIBCXX_HAVE_ATAN2L 1
+# define atan2l _atan2l
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATANF) && ! defined (_GLIBCXX_HAVE_ATANF)
+# define _GLIBCXX_HAVE_ATANF 1
+# define atanf _atanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATANL) && ! defined (_GLIBCXX_HAVE_ATANL)
+# define _GLIBCXX_HAVE_ATANL 1
+# define atanl _atanl
+#endif
+
+#if defined (_GLIBCXX_HAVE__CEILF) && ! defined (_GLIBCXX_HAVE_CEILF)
+# define _GLIBCXX_HAVE_CEILF 1
+# define ceilf _ceilf
+#endif
+
+#if defined (_GLIBCXX_HAVE__CEILL) && ! defined (_GLIBCXX_HAVE_CEILL)
+# define _GLIBCXX_HAVE_CEILL 1
+# define ceill _ceill
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSF) && ! defined (_GLIBCXX_HAVE_COSF)
+# define _GLIBCXX_HAVE_COSF 1
+# define cosf _cosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSHF) && ! defined (_GLIBCXX_HAVE_COSHF)
+# define _GLIBCXX_HAVE_COSHF 1
+# define coshf _coshf
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSHL) && ! defined (_GLIBCXX_HAVE_COSHL)
+# define _GLIBCXX_HAVE_COSHL 1
+# define coshl _coshl
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSL) && ! defined (_GLIBCXX_HAVE_COSL)
+# define _GLIBCXX_HAVE_COSL 1
+# define cosl _cosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__EXPF) && ! defined (_GLIBCXX_HAVE_EXPF)
+# define _GLIBCXX_HAVE_EXPF 1
+# define expf _expf
+#endif
+
+#if defined (_GLIBCXX_HAVE__EXPL) && ! defined (_GLIBCXX_HAVE_EXPL)
+# define _GLIBCXX_HAVE_EXPL 1
+# define expl _expl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FABSF) && ! defined (_GLIBCXX_HAVE_FABSF)
+# define _GLIBCXX_HAVE_FABSF 1
+# define fabsf _fabsf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FABSL) && ! defined (_GLIBCXX_HAVE_FABSL)
+# define _GLIBCXX_HAVE_FABSL 1
+# define fabsl _fabsl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITE) && ! defined (_GLIBCXX_HAVE_FINITE)
+# define _GLIBCXX_HAVE_FINITE 1
+# define finite _finite
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITEF) && ! defined (_GLIBCXX_HAVE_FINITEF)
+# define _GLIBCXX_HAVE_FINITEF 1
+# define finitef _finitef
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITEL) && ! defined (_GLIBCXX_HAVE_FINITEL)
+# define _GLIBCXX_HAVE_FINITEL 1
+# define finitel _finitel
+#endif
+
+#if defined (_GLIBCXX_HAVE__FLOORF) && ! defined (_GLIBCXX_HAVE_FLOORF)
+# define _GLIBCXX_HAVE_FLOORF 1
+# define floorf _floorf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FLOORL) && ! defined (_GLIBCXX_HAVE_FLOORL)
+# define _GLIBCXX_HAVE_FLOORL 1
+# define floorl _floorl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FMODF) && ! defined (_GLIBCXX_HAVE_FMODF)
+# define _GLIBCXX_HAVE_FMODF 1
+# define fmodf _fmodf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FMODL) && ! defined (_GLIBCXX_HAVE_FMODL)
+# define _GLIBCXX_HAVE_FMODL 1
+# define fmodl _fmodl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FPCLASS) && ! defined (_GLIBCXX_HAVE_FPCLASS)
+# define _GLIBCXX_HAVE_FPCLASS 1
+# define fpclass _fpclass
+#endif
+
+#if defined (_GLIBCXX_HAVE__FREXPF) && ! defined (_GLIBCXX_HAVE_FREXPF)
+# define _GLIBCXX_HAVE_FREXPF 1
+# define frexpf _frexpf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FREXPL) && ! defined (_GLIBCXX_HAVE_FREXPL)
+# define _GLIBCXX_HAVE_FREXPL 1
+# define frexpl _frexpl
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOT) && ! defined (_GLIBCXX_HAVE_HYPOT)
+# define _GLIBCXX_HAVE_HYPOT 1
+# define hypot _hypot
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOTF) && ! defined (_GLIBCXX_HAVE_HYPOTF)
+# define _GLIBCXX_HAVE_HYPOTF 1
+# define hypotf _hypotf
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOTL) && ! defined (_GLIBCXX_HAVE_HYPOTL)
+# define _GLIBCXX_HAVE_HYPOTL 1
+# define hypotl _hypotl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINF) && ! defined (_GLIBCXX_HAVE_ISINF)
+# define _GLIBCXX_HAVE_ISINF 1
+# define isinf _isinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINFF) && ! defined (_GLIBCXX_HAVE_ISINFF)
+# define _GLIBCXX_HAVE_ISINFF 1
+# define isinff _isinff
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINFL) && ! defined (_GLIBCXX_HAVE_ISINFL)
+# define _GLIBCXX_HAVE_ISINFL 1
+# define isinfl _isinfl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNAN) && ! defined (_GLIBCXX_HAVE_ISNAN)
+# define _GLIBCXX_HAVE_ISNAN 1
+# define isnan _isnan
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNANF) && ! defined (_GLIBCXX_HAVE_ISNANF)
+# define _GLIBCXX_HAVE_ISNANF 1
+# define isnanf _isnanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNANL) && ! defined (_GLIBCXX_HAVE_ISNANL)
+# define _GLIBCXX_HAVE_ISNANL 1
+# define isnanl _isnanl
+#endif
+
+#if defined (_GLIBCXX_HAVE__LDEXPF) && ! defined (_GLIBCXX_HAVE_LDEXPF)
+# define _GLIBCXX_HAVE_LDEXPF 1
+# define ldexpf _ldexpf
+#endif
+
+#if defined (_GLIBCXX_HAVE__LDEXPL) && ! defined (_GLIBCXX_HAVE_LDEXPL)
+# define _GLIBCXX_HAVE_LDEXPL 1
+# define ldexpl _ldexpl
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOG10F) && ! defined (_GLIBCXX_HAVE_LOG10F)
+# define _GLIBCXX_HAVE_LOG10F 1
+# define log10f _log10f
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOG10L) && ! defined (_GLIBCXX_HAVE_LOG10L)
+# define _GLIBCXX_HAVE_LOG10L 1
+# define log10l _log10l
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOGF) && ! defined (_GLIBCXX_HAVE_LOGF)
+# define _GLIBCXX_HAVE_LOGF 1
+# define logf _logf
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOGL) && ! defined (_GLIBCXX_HAVE_LOGL)
+# define _GLIBCXX_HAVE_LOGL 1
+# define logl _logl
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODF) && ! defined (_GLIBCXX_HAVE_MODF)
+# define _GLIBCXX_HAVE_MODF 1
+# define modf _modf
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODFF) && ! defined (_GLIBCXX_HAVE_MODFF)
+# define _GLIBCXX_HAVE_MODFF 1
+# define modff _modff
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODFL) && ! defined (_GLIBCXX_HAVE_MODFL)
+# define _GLIBCXX_HAVE_MODFL 1
+# define modfl _modfl
+#endif
+
+#if defined (_GLIBCXX_HAVE__POWF) && ! defined (_GLIBCXX_HAVE_POWF)
+# define _GLIBCXX_HAVE_POWF 1
+# define powf _powf
+#endif
+
+#if defined (_GLIBCXX_HAVE__POWL) && ! defined (_GLIBCXX_HAVE_POWL)
+# define _GLIBCXX_HAVE_POWL 1
+# define powl _powl
+#endif
+
+#if defined (_GLIBCXX_HAVE__QFPCLASS) && ! defined (_GLIBCXX_HAVE_QFPCLASS)
+# define _GLIBCXX_HAVE_QFPCLASS 1
+# define qfpclass _qfpclass
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOS) && ! defined (_GLIBCXX_HAVE_SINCOS)
+# define _GLIBCXX_HAVE_SINCOS 1
+# define sincos _sincos
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOSF) && ! defined (_GLIBCXX_HAVE_SINCOSF)
+# define _GLIBCXX_HAVE_SINCOSF 1
+# define sincosf _sincosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOSL) && ! defined (_GLIBCXX_HAVE_SINCOSL)
+# define _GLIBCXX_HAVE_SINCOSL 1
+# define sincosl _sincosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINF) && ! defined (_GLIBCXX_HAVE_SINF)
+# define _GLIBCXX_HAVE_SINF 1
+# define sinf _sinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINHF) && ! defined (_GLIBCXX_HAVE_SINHF)
+# define _GLIBCXX_HAVE_SINHF 1
+# define sinhf _sinhf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINHL) && ! defined (_GLIBCXX_HAVE_SINHL)
+# define _GLIBCXX_HAVE_SINHL 1
+# define sinhl _sinhl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINL) && ! defined (_GLIBCXX_HAVE_SINL)
+# define _GLIBCXX_HAVE_SINL 1
+# define sinl _sinl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SQRTF) && ! defined (_GLIBCXX_HAVE_SQRTF)
+# define _GLIBCXX_HAVE_SQRTF 1
+# define sqrtf _sqrtf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SQRTL) && ! defined (_GLIBCXX_HAVE_SQRTL)
+# define _GLIBCXX_HAVE_SQRTL 1
+# define sqrtl _sqrtl
+#endif
+
+#if defined (_GLIBCXX_HAVE__STRTOF) && ! defined (_GLIBCXX_HAVE_STRTOF)
+# define _GLIBCXX_HAVE_STRTOF 1
+# define strtof _strtof
+#endif
+
+#if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD)
+# define _GLIBCXX_HAVE_STRTOLD 1
+# define strtold _strtold
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANF) && ! defined (_GLIBCXX_HAVE_TANF)
+# define _GLIBCXX_HAVE_TANF 1
+# define tanf _tanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANHF) && ! defined (_GLIBCXX_HAVE_TANHF)
+# define _GLIBCXX_HAVE_TANHF 1
+# define tanhf _tanhf
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANHL) && ! defined (_GLIBCXX_HAVE_TANHL)
+# define _GLIBCXX_HAVE_TANHL 1
+# define tanhl _tanhl
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANL) && ! defined (_GLIBCXX_HAVE_TANL)
+# define _GLIBCXX_HAVE_TANL 1
+# define tanl _tanl
+#endif
+
+#endif // _GLIBCXX_CXX_CONFIG_H

+ 50 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++io.h

@@ -0,0 +1,50 @@
+// Underlying io library details -*- C++ -*-
+
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/c++io.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ios}
+ */
+
+// c_io_stdio.h - Defines for using "C" stdio.h
+
+#ifndef _GLIBCXX_CXX_IO_H
+#define _GLIBCXX_CXX_IO_H 1
+
+#include <cstdio>
+#include <bits/gthr.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  typedef __gthread_mutex_t __c_lock;
+
+  // for basic_file.h
+  typedef FILE __c_file;
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 114 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/c++locale.h

@@ -0,0 +1,114 @@
+// Wrapper for underlying C-language localization -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/c++locale.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.8  Standard locale categories.
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _GLIBCXX_CXX_LOCALE_H
+#define _GLIBCXX_CXX_LOCALE_H 1
+
+#pragma GCC system_header
+
+#include <clocale>
+
+#define _GLIBCXX_C_LOCALE_GNU 1
+
+#define _GLIBCXX_NUM_CATEGORIES 6
+
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  extern "C" __typeof(uselocale) __uselocale;
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  typedef __locale_t		__c_locale;
+
+  // Convert numeric value of type double and long double to string and
+  // return length of string.  If vsnprintf is available use it, otherwise
+  // fall back to the unsafe vsprintf which, in general, can be dangerous
+  // and should be avoided.
+  inline int
+  __convert_from_v(const __c_locale& __cloc __attribute__ ((__unused__)),
+		   char* __out,
+		   const int __size __attribute__ ((__unused__)),
+		   const char* __fmt, ...)
+  {
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+    __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+#else
+    char* __old = std::setlocale(LC_NUMERIC, 0);
+    char* __sav = 0;
+    if (__builtin_strcmp(__old, "C"))
+      {
+	const size_t __len = __builtin_strlen(__old) + 1;
+	__sav = new char[__len];
+	__builtin_memcpy(__sav, __old, __len);
+	std::setlocale(LC_NUMERIC, "C");
+      }
+#endif
+
+    __builtin_va_list __args;
+    __builtin_va_start(__args, __fmt);
+
+#if _GLIBCXX_USE_C99_STDIO
+    const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+#else
+    const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+#endif
+
+    __builtin_va_end(__args);
+
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+    __gnu_cxx::__uselocale(__old);
+#else
+    if (__sav)
+      {
+	std::setlocale(LC_NUMERIC, __sav);
+	delete [] __sav;
+      }
+#endif
+    return __ret;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 40 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/cpu_defines.h

@@ -0,0 +1,40 @@
+// Specific definitions for generic platforms  -*- C++ -*-
+
+// Copyright (C) 2015-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cpu_defines.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _GLIBCXX_CPU_DEFINES
+#define _GLIBCXX_CPU_DEFINES 1
+
+// Integer divide instructions don't trap on ARM.
+#ifdef __ARM_ARCH_EXT_IDIV__
+#define __glibcxx_integral_traps false
+#else
+#define __glibcxx_integral_traps true
+#endif
+
+#endif

+ 66 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/ctype_base.h

@@ -0,0 +1,66 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/ctype_base.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /// @brief  Base class for ctype.
+  struct ctype_base
+  {
+    // Non-standard typedefs.
+    typedef const int* 		__to_type;
+
+    // NB: Offsets into ctype<char>::_M_table force a particular size
+    // on the mask type. Because of this, we don't use an enum.
+    typedef unsigned short 	mask;
+    static const mask upper    	= _ISupper;
+    static const mask lower 	= _ISlower;
+    static const mask alpha 	= _ISalpha;
+    static const mask digit 	= _ISdigit;
+    static const mask xdigit 	= _ISxdigit;
+    static const mask space 	= _ISspace;
+    static const mask print 	= _ISprint;
+    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
+    static const mask cntrl 	= _IScntrl;
+    static const mask punct 	= _ISpunct;
+    static const mask alnum 	= _ISalpha | _ISdigit;
+#if __cplusplus >= 201103L
+    static const mask blank	= _ISblank;
+#endif
+  };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

+ 76 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/ctype_inline.h

@@ -0,0 +1,76 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/ctype_inline.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  bool
+  ctype<char>::
+  is(mask __m, char __c) const
+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+
+  const char*
+  ctype<char>::
+  is(const char* __low, const char* __high, mask* __vec) const
+  {
+    while (__low < __high)
+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+    return __high;
+  }
+
+  const char*
+  ctype<char>::
+  scan_is(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high
+	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+      ++__low;
+    return __low;
+  }
+
+  const char*
+  ctype<char>::
+  scan_not(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high
+	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+      ++__low;
+    return __low;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

+ 82 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/cxxabi_tweaks.h

@@ -0,0 +1,82 @@
+// Control various target specific ABI tweaks.  ARM version.
+
+// Copyright (C) 2004-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cxxabi_tweaks.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{cxxabi.h}
+ */
+
+#ifndef _CXXABI_TWEAKS_H
+#define _CXXABI_TWEAKS_H 1
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+  extern "C"
+  {
+#endif
+
+#ifdef __ARM_EABI__
+  // The ARM EABI uses the least significant bit of a 32-bit
+  // guard variable.  */
+#define _GLIBCXX_GUARD_TEST(x) ((*(x) & 1) != 0)
+#define _GLIBCXX_GUARD_SET(x) *(x) = 1
+#define _GLIBCXX_GUARD_BIT 1
+#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
+#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
+  typedef int __guard;
+
+  // We also want the element size in array cookies.
+#define _GLIBCXX_ELTSIZE_IN_COOKIE 1
+
+  // __cxa_vec_ctor should return a pointer to the array.
+  typedef void * __cxa_vec_ctor_return_type;
+#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return x
+  // Constructors and destructors return the "this" pointer.
+  typedef void * __cxa_cdtor_return_type;
+
+#else // __ARM_EABI__
+
+  // The generic ABI uses the first byte of a 64-bit guard variable.
+#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0)
+#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1
+#define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1)
+#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
+#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
+  __extension__ typedef int __guard __attribute__((mode (__DI__)));
+
+  // __cxa_vec_ctor has void return type.
+  typedef void __cxa_vec_ctor_return_type;
+#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return
+  // Constructors and destructors do not return a value.
+  typedef void __cxa_cdtor_return_type;
+
+#endif //!__ARM_EABI__
+
+#ifdef __cplusplus
+  }
+} // namespace __cxxabiv1
+#endif
+
+#endif

+ 178 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/error_constants.h

@@ -0,0 +1,178 @@
+// Specific definitions for generic platforms  -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/error_constants.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{system_error}
+ */
+
+#ifndef _GLIBCXX_ERROR_CONSTANTS
+#define _GLIBCXX_ERROR_CONSTANTS 1
+
+#include <bits/c++config.h>
+#include <cerrno>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  enum class errc
+    {
+      address_family_not_supported = 		EAFNOSUPPORT,
+      address_in_use = 				EADDRINUSE,
+      address_not_available = 			EADDRNOTAVAIL,
+      already_connected = 			EISCONN,
+      argument_list_too_long = 			E2BIG,
+      argument_out_of_domain = 			EDOM,
+      bad_address = 				EFAULT,
+      bad_file_descriptor = 			EBADF,
+
+#ifdef _GLIBCXX_HAVE_EBADMSG
+      bad_message = 				EBADMSG,
+#endif
+
+      broken_pipe = 				EPIPE,
+      connection_aborted = 			ECONNABORTED,
+      connection_already_in_progress = 		EALREADY,
+      connection_refused = 			ECONNREFUSED,
+      connection_reset = 			ECONNRESET,
+      cross_device_link = 			EXDEV,
+      destination_address_required = 		EDESTADDRREQ,
+      device_or_resource_busy = 		EBUSY,
+      directory_not_empty = 			ENOTEMPTY,
+      executable_format_error = 		ENOEXEC,
+      file_exists = 	       			EEXIST,
+      file_too_large = 				EFBIG,
+      filename_too_long = 			ENAMETOOLONG,
+      function_not_supported = 			ENOSYS,
+      host_unreachable = 			EHOSTUNREACH,
+
+#ifdef _GLIBCXX_HAVE_EIDRM
+      identifier_removed = 			EIDRM,
+#endif
+
+      illegal_byte_sequence = 			EILSEQ,
+      inappropriate_io_control_operation = 	ENOTTY,
+      interrupted = 				EINTR,
+      invalid_argument = 			EINVAL,
+      invalid_seek = 				ESPIPE,
+      io_error = 				EIO,
+      is_a_directory = 				EISDIR,
+      message_size = 				EMSGSIZE,
+      network_down = 				ENETDOWN,
+      network_reset = 				ENETRESET,
+      network_unreachable = 			ENETUNREACH,
+      no_buffer_space = 			ENOBUFS,
+      no_child_process = 			ECHILD,
+
+#ifdef _GLIBCXX_HAVE_ENOLINK
+      no_link = 				ENOLINK,
+#endif
+
+      no_lock_available = 			ENOLCK,
+
+#ifdef _GLIBCXX_HAVE_ENODATA
+      no_message_available = 			ENODATA,
+#endif
+
+      no_message = 				ENOMSG,
+      no_protocol_option = 			ENOPROTOOPT,
+      no_space_on_device = 			ENOSPC,
+
+#ifdef _GLIBCXX_HAVE_ENOSR
+      no_stream_resources = 			ENOSR,
+#endif
+
+      no_such_device_or_address = 		ENXIO,
+      no_such_device = 				ENODEV,
+      no_such_file_or_directory = 		ENOENT,
+      no_such_process = 			ESRCH,
+      not_a_directory = 			ENOTDIR,
+      not_a_socket = 				ENOTSOCK,
+
+#ifdef _GLIBCXX_HAVE_ENOSTR
+      not_a_stream = 				ENOSTR,
+#endif
+
+      not_connected = 				ENOTCONN,
+      not_enough_memory = 			ENOMEM,
+
+#ifdef _GLIBCXX_HAVE_ENOTSUP
+      not_supported = 				ENOTSUP,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ECANCELED
+      operation_canceled = 			ECANCELED,
+#endif
+
+      operation_in_progress = 			EINPROGRESS,
+      operation_not_permitted = 		EPERM,
+      operation_not_supported = 		EOPNOTSUPP,
+      operation_would_block = 			EWOULDBLOCK,
+
+#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+      owner_dead = 				EOWNERDEAD,
+#endif
+
+      permission_denied = 			EACCES,
+
+#ifdef _GLIBCXX_HAVE_EPROTO
+      protocol_error = 				EPROTO,
+#endif
+
+      protocol_not_supported = 			EPROTONOSUPPORT,
+      read_only_file_system = 			EROFS,
+      resource_deadlock_would_occur = 		EDEADLK,
+      resource_unavailable_try_again = 		EAGAIN,
+      result_out_of_range = 			ERANGE,
+
+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+      state_not_recoverable = 			ENOTRECOVERABLE,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETIME
+      stream_timeout = 				ETIME,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETXTBSY
+      text_file_busy = 				ETXTBSY,
+#endif
+
+      timed_out = 				ETIMEDOUT,
+      too_many_files_open_in_system = 		ENFILE,
+      too_many_files_open = 			EMFILE,
+      too_many_links = 				EMLINK,
+      too_many_symbolic_link_levels = 		ELOOP,
+
+#ifdef _GLIBCXX_HAVE_EOVERFLOW
+      value_too_large = 			EOVERFLOW,
+#endif
+
+      wrong_protocol_type = 			EPROTOTYPE
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 84 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/extc++.h

@@ -0,0 +1,84 @@
+// C++ includes used for precompiling extensions -*- C++ -*-
+
+// Copyright (C) 2006-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file extc++.h
+ *  This is an implementation file for a precompiled header.
+ */
+
+#if __cplusplus < 201103L
+#include <bits/stdtr1c++.h>
+#else
+#include <bits/stdc++.h>
+#endif
+
+#include <ext/algorithm>
+#if __cplusplus >= 201103L
+# include <ext/aligned_buffer.h>
+#endif
+#include <ext/alloc_traits.h>
+#include <ext/array_allocator.h>
+#include <ext/atomicity.h>
+#include <ext/bitmap_allocator.h>
+#include <ext/cast.h>
+#if __cplusplus >= 201103L
+# include <ext/cmath>
+#endif
+#include <ext/concurrence.h>
+#include <ext/debug_allocator.h>
+#include <ext/extptr_allocator.h>
+#include <ext/functional>
+#include <ext/iterator>
+#include <ext/malloc_allocator.h>
+#include <ext/memory>
+#include <ext/mt_allocator.h>
+#include <ext/new_allocator.h>
+#include <ext/numeric>
+#include <ext/numeric_traits.h>
+#include <ext/pod_char_traits.h>
+#include <ext/pointer.h>
+#include <ext/pool_allocator.h>
+#if __cplusplus >= 201103L
+# include <ext/random>
+#endif
+#include <ext/rb_tree>
+#include <ext/rope>
+#include <ext/slist>
+#include <ext/stdio_filebuf.h>
+#include <ext/stdio_sync_filebuf.h>
+#include <ext/throw_allocator.h>
+#include <ext/typelist.h>
+#include <ext/type_traits.h>
+#include <ext/vstring.h>
+#include <ext/pb_ds/assoc_container.hpp>
+#include <ext/pb_ds/priority_queue.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/hash_policy.hpp>
+#include <ext/pb_ds/list_update_policy.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/trie_policy.hpp>
+
+#ifdef _GLIBCXX_HAVE_ICONV
+ #include <ext/codecvt_specializations.h>
+ #include <ext/enc_filebuf.h>
+#endif

+ 889 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr-default.h

@@ -0,0 +1,889 @@
+/* Threads compatibility routines for libgcc2 and libobjc.  */
+/* Compile this one with gcc.  */
+/* Copyright (C) 1997-2017 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
+#define _GLIBCXX_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+   Easy, since the interface is just one-to-one mapping.  */
+
+#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
+
+#include <pthread.h>
+
+#if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
+     || !defined(_GTHREAD_USE_MUTEX_TIMEDLOCK))
+# include <unistd.h>
+# if defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 0
+#  define _GTHREAD_USE_MUTEX_TIMEDLOCK 1
+# else
+#  define _GTHREAD_USE_MUTEX_TIMEDLOCK 0
+# endif
+#endif
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+
+/* POSIX like conditional variables are supported.  Please look at comments
+   in gthr.h for details. */
+#define __GTHREAD_HAS_COND	1
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#else
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
+
+#ifdef _GTHREAD_USE_MUTEX_INIT_FUNC
+# undef __GTHREAD_MUTEX_INIT
+#endif
+#ifdef _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
+# undef __GTHREAD_RECURSIVE_MUTEX_INIT
+# undef __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
+# define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#ifdef _GTHREAD_USE_COND_INIT_FUNC
+# undef __GTHREAD_COND_INIT
+# define __GTHREAD_COND_INIT_FUNCTION __gthread_cond_init_function
+#endif
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+#  define __gthrw_pragma(pragma)
+# endif
+# define __gthrw2(name,name2,type) \
+  static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+  __gthrw_pragma(weak type)
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw2(name,name2,type)
+# define __gthrw_(name) name
+#endif
+
+/* Typically, __gthrw_foo is a weak reference to symbol foo.  */
+#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
+
+__gthrw(pthread_once)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+
+__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
+#ifndef __BIONIC__
+__gthrw(pthread_cancel)
+#endif
+__gthrw(sched_yield)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+__gthrw(pthread_mutex_timedlock)
+#endif
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+__gthrw(pthread_cond_init)
+__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
+__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
+
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+
+
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+/* Objective-C.  */
+__gthrw(pthread_exit)
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(sched_get_priority_max)
+__gthrw(sched_get_priority_min)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+__gthrw(pthread_attr_destroy)
+__gthrw(pthread_attr_init)
+__gthrw(pthread_attr_setdetachstate)
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(pthread_getschedparam)
+__gthrw(pthread_setschedparam)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+
+/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
+   -pthreads is not specified.  The functions are dummies and most return an
+   error value.  However pthread_once returns 0 without invoking the routine
+   it is passed so we cannot pretend that the interface is active if -pthreads
+   is not specified.  On Solaris 2.5.1, the interface is not exposed at all so
+   we need to play the usual game with weak symbols.  On Solaris 10 and up, a
+   working interface is always exposed.  On FreeBSD 6 and later, libc also
+   exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+   to 9 does.  FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+   which means the alternate __gthread_active_p below cannot be used there.  */
+
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+  __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+  static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+  static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;
+
+  /* Avoid reading __gthread_active twice on the main code path.  */
+  int __gthread_active_latest_value = __gthread_active;
+
+  /* This test is not protected to avoid taking a lock on the main code
+     path so every update of __gthread_active in a threaded program must
+     be atomic with regard to the result of the test.  */
+  if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+    {
+      if (__gthrw_(pthread_once))
+	{
+	  /* If this really is a threaded program, then we must ensure that
+	     __gthread_active has been set to 1 before exiting this block.  */
+	  __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+	  __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
+	  __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+	}
+
+      /* Make sure we'll never enter this block again.  */
+      if (__gthread_active < 0)
+	__gthread_active = 0;
+
+      __gthread_active_latest_value = __gthread_active;
+    }
+
+  return __gthread_active_latest_value != 0;
+}
+
+#else /* neither FreeBSD nor Solaris */
+
+/* For a program to be multi-threaded the only thing that it certainly must
+   be using is pthread_create.  However, there may be other libraries that
+   intercept pthread_create with their own definitions to wrap pthreads
+   functionality for some purpose.  In those cases, pthread_create being
+   defined might not necessarily mean that libpthread is actually linked
+   in.
+
+   For the GNU C library, we can use a known internal name.  This is always
+   available in the ABI, but no other library would define it.  That is
+   ideal, since any public pthread function might be intercepted just as
+   pthread_create might be.  __pthread_key_create is an "internal"
+   implementation symbol, but it is part of the public exported ABI.  Also,
+   it's among the symbols that the static libpthread.a always links in
+   whenever pthread_create is used, so there is no danger of a false
+   negative result in any statically-linked, multi-threaded program.
+
+   For others, we choose pthread_cancel as a function that seems unlikely
+   to be redefined by an interceptor library.  The bionic (Android) C
+   library does not provide pthread_cancel, so we do use pthread_create
+   there (and interceptor libraries lose).  */
+
+#ifdef __GLIBC__
+__gthrw2(__gthrw_(__pthread_key_create),
+	 __pthread_key_create,
+	 pthread_key_create)
+# define GTHR_ACTIVE_PROXY	__gthrw_(__pthread_key_create)
+#elif defined (__BIONIC__)
+# define GTHR_ACTIVE_PROXY	__gthrw_(pthread_create)
+#else
+# define GTHR_ACTIVE_PROXY	__gthrw_(pthread_cancel)
+#endif
+
+static inline int
+__gthread_active_p (void)
+{
+  static void *const __gthread_active_ptr
+    = __extension__ (void *) &GTHR_ACTIVE_PROXY;
+  return __gthread_active_ptr != 0;
+}
+
+#endif /* FreeBSD or Solaris */
+
+#else /* not __GXX_WEAK__ */
+
+/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
+   calls in shared flavors of the HP-UX C library.  Most of the stubs
+   have no functionality.  The details are described in the "libc cumulative
+   patch" for each subversion of HP-UX 11.  There are two special interfaces
+   provided for checking whether an application is linked to a shared pthread
+   library or not.  However, these interfaces aren't available in early
+   libpthread libraries.  We also need a test that works for archive
+   libraries.  We can't use pthread_once as some libc versions call the
+   init function.  We also can't use pthread_create or pthread_attr_init
+   as these create a thread and thereby prevent changing the default stack
+   size.  The function pthread_default_stacksize_np is available in both
+   the archive and shared versions of libpthread.   It can be used to
+   determine the default pthread stack size.  There is a stub in some
+   shared libc versions which returns a zero size if pthreads are not
+   active.  We provide an equivalent stub to handle cases where libc
+   doesn't provide one.  */
+
+#if defined(__hppa__) && defined(__hpux__)
+
+static volatile int __gthread_active = -1;
+
+static inline int
+__gthread_active_p (void)
+{
+  /* Avoid reading __gthread_active twice on the main code path.  */
+  int __gthread_active_latest_value = __gthread_active;
+  size_t __s;
+
+  if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+    {
+      pthread_default_stacksize_np (0, &__s);
+      __gthread_active = __s ? 1 : 0;
+      __gthread_active_latest_value = __gthread_active;
+    }
+
+  return __gthread_active_latest_value != 0;
+}
+
+#else /* not hppa-hpux */
+
+static inline int
+__gthread_active_p (void)
+{
+  return 1;
+}
+
+#endif /* hppa-hpux */
+
+#endif /* __GXX_WEAK__ */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem.  */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+  if (__gthread_active_p ())
+    {
+      /* Initialize the thread storage key.  */
+      if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
+	{
+	  /* The normal default detach state for threads is
+	   * PTHREAD_CREATE_JOINABLE which causes threads to not die
+	   * when you think they should.  */
+	  if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
+	      && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
+					      PTHREAD_CREATE_DETACHED) == 0)
+	    return 0;
+	}
+    }
+
+  return -1;
+}
+
+/* Close the threads subsystem.  */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
+      && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
+    return 0;
+
+  return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution.  */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
+{
+  objc_thread_t thread_id;
+  pthread_t new_thread_handle;
+
+  if (!__gthread_active_p ())
+    return NULL;
+
+  if (!(__gthrw_(pthread_create) (&new_thread_handle, &_objc_thread_attribs,
+				  (void *) func, arg)))
+    thread_id = (objc_thread_t) new_thread_handle;
+  else
+    thread_id = NULL;
+
+  return thread_id;
+}
+
+/* Set the current thread's priority.  */
+static inline int
+__gthread_objc_thread_set_priority (int priority)
+{
+  if (!__gthread_active_p ())
+    return -1;
+  else
+    {
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+      pthread_t thread_id = __gthrw_(pthread_self) ();
+      int policy;
+      struct sched_param params;
+      int priority_min, priority_max;
+
+      if (__gthrw_(pthread_getschedparam) (thread_id, &policy, &params) == 0)
+	{
+	  if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
+	    return -1;
+
+	  if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
+	    return -1;
+
+	  if (priority > priority_max)
+	    priority = priority_max;
+	  else if (priority < priority_min)
+	    priority = priority_min;
+	  params.sched_priority = priority;
+
+	  /*
+	   * The solaris 7 and several other man pages incorrectly state that
+	   * this should be a pointer to policy but pthread.h is universally
+	   * at odds with this.
+	   */
+	  if (__gthrw_(pthread_setschedparam) (thread_id, policy, &params) == 0)
+	    return 0;
+	}
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+      return -1;
+    }
+}
+
+/* Return the current thread's priority.  */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+  if (__gthread_active_p ())
+    {
+      int policy;
+      struct sched_param params;
+
+      if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, &params) == 0)
+	return params.sched_priority;
+      else
+	return -1;
+    }
+  else
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+    return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread.  */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+  if (__gthread_active_p ())
+    __gthrw_(sched_yield) ();
+}
+
+/* Terminate the current thread.  */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+  if (__gthread_active_p ())
+    /* exit the thread */
+    __gthrw_(pthread_exit) (&__objc_thread_exit_status);
+
+  /* Failed if we reached here */
+  return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread.  */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+  if (__gthread_active_p ())
+    return (objc_thread_t) __gthrw_(pthread_self) ();
+  else
+    return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer.  */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
+  else
+    {
+      thread_local_storage = value;
+      return 0;
+    }
+}
+
+/* Returns the thread's local storage pointer.  */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_getspecific) (_objc_thread_storage);
+  else
+    return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex.  */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ())
+    {
+      mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
+
+      if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
+	{
+	  objc_free (mutex->backend);
+	  mutex->backend = NULL;
+	  return -1;
+	}
+    }
+
+  return 0;
+}
+
+/* Deallocate a mutex.  */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ())
+    {
+      int count;
+
+      /*
+       * Posix Threads specifically require that the thread be unlocked
+       * for __gthrw_(pthread_mutex_destroy) to work.
+       */
+
+      do
+	{
+	  count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
+	  if (count < 0)
+	    return -1;
+	}
+      while (count);
+
+      if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
+	return -1;
+
+      objc_free (mutex->backend);
+      mutex->backend = NULL;
+    }
+  return 0;
+}
+
+/* Grab a lock on a mutex.  */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
+    {
+      return -1;
+    }
+
+  return 0;
+}
+
+/* Try to grab a lock on a mutex.  */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
+    {
+      return -1;
+    }
+
+  return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
+    {
+      return -1;
+    }
+
+  return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition.  */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    {
+      condition->backend = objc_malloc (sizeof (pthread_cond_t));
+
+      if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
+	{
+	  objc_free (condition->backend);
+	  condition->backend = NULL;
+	  return -1;
+	}
+    }
+
+  return 0;
+}
+
+/* Deallocate a condition.  */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    {
+      if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
+	return -1;
+
+      objc_free (condition->backend);
+      condition->backend = NULL;
+    }
+  return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
+			      (pthread_mutex_t *) mutex->backend);
+  else
+    return 0;
+}
+
+/* Wake up all threads waiting on this condition.  */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
+  else
+    return 0;
+}
+
+/* Wake up one thread waiting on this condition.  */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
+  else
+    return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+		  void *__args)
+{
+  return __gthrw_(pthread_create) (__threadid, NULL, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+  return __gthrw_(pthread_join) (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+  return __gthrw_(pthread_detach) (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+  return __gthrw_(pthread_equal) (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+  return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+  return __gthrw_(sched_yield) ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_once) (__once, __func);
+  else
+    return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+  return __gthrw_(pthread_key_create) (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+  return __gthrw_(pthread_key_delete) (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+  return __gthrw_(pthread_getspecific) (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+  return __gthrw_(pthread_setspecific) (__key, __ptr);
+}
+
+static inline void
+__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    __gthrw_(pthread_mutex_init) (__mutex, NULL);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_destroy) (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_lock) (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_trylock) (__mutex);
+  else
+    return 0;
+}
+
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+			   const __gthread_time_t *__abs_timeout)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
+  else
+    return 0;
+}
+#endif
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_unlock) (__mutex);
+  else
+    return 0;
+}
+
+#if !defined( PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) \
+  || defined(_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC)
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    {
+      pthread_mutexattr_t __attr;
+      int __r;
+
+      __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+      if (!__r)
+	__r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+						   PTHREAD_MUTEX_RECURSIVE);
+      if (!__r)
+	__r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+      if (!__r)
+	__r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+      return __r;
+    }
+  return 0;
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_trylock (__mutex);
+}
+
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+				     const __gthread_time_t *__abs_timeout)
+{
+  return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_destroy (__mutex);
+}
+
+#ifdef _GTHREAD_USE_COND_INIT_FUNC
+static inline void
+__gthread_cond_init_function (__gthread_cond_t *__cond)
+{
+  if (__gthread_active_p ())
+    __gthrw_(pthread_cond_init) (__cond, NULL);
+}
+#endif
+
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+  return __gthrw_(pthread_cond_broadcast) (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+  return __gthrw_(pthread_cond_signal) (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+  return __gthrw_(pthread_cond_wait) (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+			  const __gthread_time_t *__abs_timeout)
+{
+  return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+			       __gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+  return __gthrw_(pthread_cond_destroy) (__cond);
+}
+
+#endif /* _LIBOBJC */
+
+#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */

+ 889 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr-posix.h

@@ -0,0 +1,889 @@
+/* Threads compatibility routines for libgcc2 and libobjc.  */
+/* Compile this one with gcc.  */
+/* Copyright (C) 1997-2017 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
+#define _GLIBCXX_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+   Easy, since the interface is just one-to-one mapping.  */
+
+#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
+
+#include <pthread.h>
+
+#if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
+     || !defined(_GTHREAD_USE_MUTEX_TIMEDLOCK))
+# include <unistd.h>
+# if defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 0
+#  define _GTHREAD_USE_MUTEX_TIMEDLOCK 1
+# else
+#  define _GTHREAD_USE_MUTEX_TIMEDLOCK 0
+# endif
+#endif
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+
+/* POSIX like conditional variables are supported.  Please look at comments
+   in gthr.h for details. */
+#define __GTHREAD_HAS_COND	1
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#else
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
+
+#ifdef _GTHREAD_USE_MUTEX_INIT_FUNC
+# undef __GTHREAD_MUTEX_INIT
+#endif
+#ifdef _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
+# undef __GTHREAD_RECURSIVE_MUTEX_INIT
+# undef __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
+# define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#ifdef _GTHREAD_USE_COND_INIT_FUNC
+# undef __GTHREAD_COND_INIT
+# define __GTHREAD_COND_INIT_FUNCTION __gthread_cond_init_function
+#endif
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+#  define __gthrw_pragma(pragma)
+# endif
+# define __gthrw2(name,name2,type) \
+  static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+  __gthrw_pragma(weak type)
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw2(name,name2,type)
+# define __gthrw_(name) name
+#endif
+
+/* Typically, __gthrw_foo is a weak reference to symbol foo.  */
+#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
+
+__gthrw(pthread_once)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+
+__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
+#ifndef __BIONIC__
+__gthrw(pthread_cancel)
+#endif
+__gthrw(sched_yield)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+__gthrw(pthread_mutex_timedlock)
+#endif
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+__gthrw(pthread_cond_init)
+__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
+__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
+
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+
+
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+/* Objective-C.  */
+__gthrw(pthread_exit)
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(sched_get_priority_max)
+__gthrw(sched_get_priority_min)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+__gthrw(pthread_attr_destroy)
+__gthrw(pthread_attr_init)
+__gthrw(pthread_attr_setdetachstate)
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(pthread_getschedparam)
+__gthrw(pthread_setschedparam)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+
+/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
+   -pthreads is not specified.  The functions are dummies and most return an
+   error value.  However pthread_once returns 0 without invoking the routine
+   it is passed so we cannot pretend that the interface is active if -pthreads
+   is not specified.  On Solaris 2.5.1, the interface is not exposed at all so
+   we need to play the usual game with weak symbols.  On Solaris 10 and up, a
+   working interface is always exposed.  On FreeBSD 6 and later, libc also
+   exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+   to 9 does.  FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+   which means the alternate __gthread_active_p below cannot be used there.  */
+
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+  __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+  static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+  static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;
+
+  /* Avoid reading __gthread_active twice on the main code path.  */
+  int __gthread_active_latest_value = __gthread_active;
+
+  /* This test is not protected to avoid taking a lock on the main code
+     path so every update of __gthread_active in a threaded program must
+     be atomic with regard to the result of the test.  */
+  if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+    {
+      if (__gthrw_(pthread_once))
+	{
+	  /* If this really is a threaded program, then we must ensure that
+	     __gthread_active has been set to 1 before exiting this block.  */
+	  __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+	  __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
+	  __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+	}
+
+      /* Make sure we'll never enter this block again.  */
+      if (__gthread_active < 0)
+	__gthread_active = 0;
+
+      __gthread_active_latest_value = __gthread_active;
+    }
+
+  return __gthread_active_latest_value != 0;
+}
+
+#else /* neither FreeBSD nor Solaris */
+
+/* For a program to be multi-threaded the only thing that it certainly must
+   be using is pthread_create.  However, there may be other libraries that
+   intercept pthread_create with their own definitions to wrap pthreads
+   functionality for some purpose.  In those cases, pthread_create being
+   defined might not necessarily mean that libpthread is actually linked
+   in.
+
+   For the GNU C library, we can use a known internal name.  This is always
+   available in the ABI, but no other library would define it.  That is
+   ideal, since any public pthread function might be intercepted just as
+   pthread_create might be.  __pthread_key_create is an "internal"
+   implementation symbol, but it is part of the public exported ABI.  Also,
+   it's among the symbols that the static libpthread.a always links in
+   whenever pthread_create is used, so there is no danger of a false
+   negative result in any statically-linked, multi-threaded program.
+
+   For others, we choose pthread_cancel as a function that seems unlikely
+   to be redefined by an interceptor library.  The bionic (Android) C
+   library does not provide pthread_cancel, so we do use pthread_create
+   there (and interceptor libraries lose).  */
+
+#ifdef __GLIBC__
+__gthrw2(__gthrw_(__pthread_key_create),
+	 __pthread_key_create,
+	 pthread_key_create)
+# define GTHR_ACTIVE_PROXY	__gthrw_(__pthread_key_create)
+#elif defined (__BIONIC__)
+# define GTHR_ACTIVE_PROXY	__gthrw_(pthread_create)
+#else
+# define GTHR_ACTIVE_PROXY	__gthrw_(pthread_cancel)
+#endif
+
+static inline int
+__gthread_active_p (void)
+{
+  static void *const __gthread_active_ptr
+    = __extension__ (void *) &GTHR_ACTIVE_PROXY;
+  return __gthread_active_ptr != 0;
+}
+
+#endif /* FreeBSD or Solaris */
+
+#else /* not __GXX_WEAK__ */
+
+/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
+   calls in shared flavors of the HP-UX C library.  Most of the stubs
+   have no functionality.  The details are described in the "libc cumulative
+   patch" for each subversion of HP-UX 11.  There are two special interfaces
+   provided for checking whether an application is linked to a shared pthread
+   library or not.  However, these interfaces aren't available in early
+   libpthread libraries.  We also need a test that works for archive
+   libraries.  We can't use pthread_once as some libc versions call the
+   init function.  We also can't use pthread_create or pthread_attr_init
+   as these create a thread and thereby prevent changing the default stack
+   size.  The function pthread_default_stacksize_np is available in both
+   the archive and shared versions of libpthread.   It can be used to
+   determine the default pthread stack size.  There is a stub in some
+   shared libc versions which returns a zero size if pthreads are not
+   active.  We provide an equivalent stub to handle cases where libc
+   doesn't provide one.  */
+
+#if defined(__hppa__) && defined(__hpux__)
+
+static volatile int __gthread_active = -1;
+
+static inline int
+__gthread_active_p (void)
+{
+  /* Avoid reading __gthread_active twice on the main code path.  */
+  int __gthread_active_latest_value = __gthread_active;
+  size_t __s;
+
+  if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+    {
+      pthread_default_stacksize_np (0, &__s);
+      __gthread_active = __s ? 1 : 0;
+      __gthread_active_latest_value = __gthread_active;
+    }
+
+  return __gthread_active_latest_value != 0;
+}
+
+#else /* not hppa-hpux */
+
+static inline int
+__gthread_active_p (void)
+{
+  return 1;
+}
+
+#endif /* hppa-hpux */
+
+#endif /* __GXX_WEAK__ */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem.  */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+  if (__gthread_active_p ())
+    {
+      /* Initialize the thread storage key.  */
+      if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
+	{
+	  /* The normal default detach state for threads is
+	   * PTHREAD_CREATE_JOINABLE which causes threads to not die
+	   * when you think they should.  */
+	  if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
+	      && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
+					      PTHREAD_CREATE_DETACHED) == 0)
+	    return 0;
+	}
+    }
+
+  return -1;
+}
+
+/* Close the threads subsystem.  */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
+      && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
+    return 0;
+
+  return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution.  */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
+{
+  objc_thread_t thread_id;
+  pthread_t new_thread_handle;
+
+  if (!__gthread_active_p ())
+    return NULL;
+
+  if (!(__gthrw_(pthread_create) (&new_thread_handle, &_objc_thread_attribs,
+				  (void *) func, arg)))
+    thread_id = (objc_thread_t) new_thread_handle;
+  else
+    thread_id = NULL;
+
+  return thread_id;
+}
+
+/* Set the current thread's priority.  */
+static inline int
+__gthread_objc_thread_set_priority (int priority)
+{
+  if (!__gthread_active_p ())
+    return -1;
+  else
+    {
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+      pthread_t thread_id = __gthrw_(pthread_self) ();
+      int policy;
+      struct sched_param params;
+      int priority_min, priority_max;
+
+      if (__gthrw_(pthread_getschedparam) (thread_id, &policy, &params) == 0)
+	{
+	  if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
+	    return -1;
+
+	  if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
+	    return -1;
+
+	  if (priority > priority_max)
+	    priority = priority_max;
+	  else if (priority < priority_min)
+	    priority = priority_min;
+	  params.sched_priority = priority;
+
+	  /*
+	   * The solaris 7 and several other man pages incorrectly state that
+	   * this should be a pointer to policy but pthread.h is universally
+	   * at odds with this.
+	   */
+	  if (__gthrw_(pthread_setschedparam) (thread_id, policy, &params) == 0)
+	    return 0;
+	}
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+      return -1;
+    }
+}
+
+/* Return the current thread's priority.  */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+  if (__gthread_active_p ())
+    {
+      int policy;
+      struct sched_param params;
+
+      if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, &params) == 0)
+	return params.sched_priority;
+      else
+	return -1;
+    }
+  else
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+    return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread.  */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+  if (__gthread_active_p ())
+    __gthrw_(sched_yield) ();
+}
+
+/* Terminate the current thread.  */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+  if (__gthread_active_p ())
+    /* exit the thread */
+    __gthrw_(pthread_exit) (&__objc_thread_exit_status);
+
+  /* Failed if we reached here */
+  return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread.  */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+  if (__gthread_active_p ())
+    return (objc_thread_t) __gthrw_(pthread_self) ();
+  else
+    return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer.  */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
+  else
+    {
+      thread_local_storage = value;
+      return 0;
+    }
+}
+
+/* Returns the thread's local storage pointer.  */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_getspecific) (_objc_thread_storage);
+  else
+    return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex.  */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ())
+    {
+      mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
+
+      if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
+	{
+	  objc_free (mutex->backend);
+	  mutex->backend = NULL;
+	  return -1;
+	}
+    }
+
+  return 0;
+}
+
+/* Deallocate a mutex.  */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ())
+    {
+      int count;
+
+      /*
+       * Posix Threads specifically require that the thread be unlocked
+       * for __gthrw_(pthread_mutex_destroy) to work.
+       */
+
+      do
+	{
+	  count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
+	  if (count < 0)
+	    return -1;
+	}
+      while (count);
+
+      if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
+	return -1;
+
+      objc_free (mutex->backend);
+      mutex->backend = NULL;
+    }
+  return 0;
+}
+
+/* Grab a lock on a mutex.  */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
+    {
+      return -1;
+    }
+
+  return 0;
+}
+
+/* Try to grab a lock on a mutex.  */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
+    {
+      return -1;
+    }
+
+  return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex)
+{
+  if (__gthread_active_p ()
+      && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
+    {
+      return -1;
+    }
+
+  return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition.  */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    {
+      condition->backend = objc_malloc (sizeof (pthread_cond_t));
+
+      if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
+	{
+	  objc_free (condition->backend);
+	  condition->backend = NULL;
+	  return -1;
+	}
+    }
+
+  return 0;
+}
+
+/* Deallocate a condition.  */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    {
+      if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
+	return -1;
+
+      objc_free (condition->backend);
+      condition->backend = NULL;
+    }
+  return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
+			      (pthread_mutex_t *) mutex->backend);
+  else
+    return 0;
+}
+
+/* Wake up all threads waiting on this condition.  */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
+  else
+    return 0;
+}
+
+/* Wake up one thread waiting on this condition.  */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
+  else
+    return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+		  void *__args)
+{
+  return __gthrw_(pthread_create) (__threadid, NULL, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+  return __gthrw_(pthread_join) (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+  return __gthrw_(pthread_detach) (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+  return __gthrw_(pthread_equal) (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+  return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+  return __gthrw_(sched_yield) ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_once) (__once, __func);
+  else
+    return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+  return __gthrw_(pthread_key_create) (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+  return __gthrw_(pthread_key_delete) (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+  return __gthrw_(pthread_getspecific) (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+  return __gthrw_(pthread_setspecific) (__key, __ptr);
+}
+
+static inline void
+__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    __gthrw_(pthread_mutex_init) (__mutex, NULL);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_destroy) (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_lock) (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_trylock) (__mutex);
+  else
+    return 0;
+}
+
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+			   const __gthread_time_t *__abs_timeout)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
+  else
+    return 0;
+}
+#endif
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_unlock) (__mutex);
+  else
+    return 0;
+}
+
+#if !defined( PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) \
+  || defined(_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC)
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    {
+      pthread_mutexattr_t __attr;
+      int __r;
+
+      __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+      if (!__r)
+	__r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+						   PTHREAD_MUTEX_RECURSIVE);
+      if (!__r)
+	__r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+      if (!__r)
+	__r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+      return __r;
+    }
+  return 0;
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_trylock (__mutex);
+}
+
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+				     const __gthread_time_t *__abs_timeout)
+{
+  return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_destroy (__mutex);
+}
+
+#ifdef _GTHREAD_USE_COND_INIT_FUNC
+static inline void
+__gthread_cond_init_function (__gthread_cond_t *__cond)
+{
+  if (__gthread_active_p ())
+    __gthrw_(pthread_cond_init) (__cond, NULL);
+}
+#endif
+
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+  return __gthrw_(pthread_cond_broadcast) (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+  return __gthrw_(pthread_cond_signal) (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+  return __gthrw_(pthread_cond_wait) (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+			  const __gthread_time_t *__abs_timeout)
+{
+  return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+			       __gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+  return __gthrw_(pthread_cond_destroy) (__cond);
+}
+
+#endif /* _LIBOBJC */
+
+#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */

+ 298 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr-single.h

@@ -0,0 +1,298 @@
+/* Threads compatibility routines for libgcc2 and libobjc.  */
+/* Compile this one with gcc.  */
+/* Copyright (C) 1997-2017 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef _GLIBCXX_GCC_GTHR_SINGLE_H
+#define _GLIBCXX_GCC_GTHR_SINGLE_H
+
+/* Just provide compatibility for mutex handling.  */
+
+typedef int __gthread_key_t;
+typedef int __gthread_once_t;
+typedef int __gthread_mutex_t;
+typedef int __gthread_recursive_mutex_t;
+
+#define __GTHREAD_ONCE_INIT 0
+#define __GTHREAD_MUTEX_INIT 0
+#define __GTHREAD_MUTEX_INIT_FUNCTION(mx) do {} while (0)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
+
+#define _GLIBCXX_UNUSED __attribute__((__unused__))
+
+#ifdef _LIBOBJC
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem.  */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+  /* No thread support available */
+  return -1;
+}
+
+/* Close the threads subsystem.  */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+  /* No thread support available */
+  return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution.  */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (* func)(void *), void * arg _GLIBCXX_UNUSED)
+{
+  /* No thread support available */
+  return NULL;
+}
+
+/* Set the current thread's priority.  */
+static inline int
+__gthread_objc_thread_set_priority (int priority _GLIBCXX_UNUSED)
+{
+  /* No thread support available */
+  return -1;
+}
+
+/* Return the current thread's priority.  */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+  return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread.  */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+  return;
+}
+
+/* Terminate the current thread.  */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+  /* No thread support available */
+  /* Should we really exit the program */
+  /* exit (&__objc_thread_exit_status); */
+  return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread.  */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+  /* No thread support, use 1.  */
+  return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer.  */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+  thread_local_storage = value;
+  return 0;
+}
+
+/* Returns the thread's local storage pointer.  */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+  return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex.  */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Deallocate a mutex.  */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Grab a lock on a mutex.  */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+  /* There can only be one thread, so we always get the lock */
+  return 0;
+}
+
+/* Try to grab a lock on a mutex.  */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+  /* There can only be one thread, so we always get the lock */
+  return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition.  */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Deallocate a condition.  */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition _GLIBCXX_UNUSED,
+			       objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Wake up all threads waiting on this condition.  */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+/* Wake up one thread waiting on this condition.  */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_active_p (void)
+{
+  return 0;
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once _GLIBCXX_UNUSED, void (*__func) (void) _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int _GLIBCXX_UNUSED
+__gthread_key_create (__gthread_key_t *__key _GLIBCXX_UNUSED, void (*__func) (void *) _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static int _GLIBCXX_UNUSED
+__gthread_key_delete (__gthread_key_t __key _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key _GLIBCXX_UNUSED, const void *__v _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+  return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_trylock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_destroy (__mutex);
+}
+
+#endif /* _LIBOBJC */
+
+#undef _GLIBCXX_UNUSED
+
+#endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */

+ 154 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/gthr.h

@@ -0,0 +1,154 @@
+/* Threads compatibility routines for libgcc2.  */
+/* Compile this one with gcc.  */
+/* Copyright (C) 1997-2017 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef _GLIBCXX_GCC_GTHR_H
+#define _GLIBCXX_GCC_GTHR_H
+
+#ifndef _GLIBCXX_HIDE_EXPORTS
+#pragma GCC visibility push(default)
+#endif
+
+/* If this file is compiled with threads support, it must
+       #define __GTHREADS 1
+   to indicate that threads support is present.  Also it has define
+   function
+     int __gthread_active_p ()
+   that returns 1 if thread system is active, 0 if not.
+
+   The threads interface must define the following types:
+     __gthread_key_t
+     __gthread_once_t
+     __gthread_mutex_t
+     __gthread_recursive_mutex_t
+
+   The threads interface must define the following macros:
+
+     __GTHREAD_ONCE_INIT
+     		to initialize __gthread_once_t
+     __GTHREAD_MUTEX_INIT
+     		to initialize __gthread_mutex_t to get a fast
+		non-recursive mutex.
+     __GTHREAD_MUTEX_INIT_FUNCTION
+		to initialize __gthread_mutex_t to get a fast
+		non-recursive mutex.
+		Define this to a function which looks like this:
+		  void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
+     		Some systems can't initialize a mutex without a
+		function call.  Don't define __GTHREAD_MUTEX_INIT in this case.
+     __GTHREAD_RECURSIVE_MUTEX_INIT
+     __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
+     		as above, but for a recursive mutex.
+
+   The threads interface must define the following static functions:
+
+     int __gthread_once (__gthread_once_t *once, void (*func) ())
+
+     int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
+     int __gthread_key_delete (__gthread_key_t key)
+
+     void *__gthread_getspecific (__gthread_key_t key)
+     int __gthread_setspecific (__gthread_key_t key, const void *ptr)
+
+     int __gthread_mutex_destroy (__gthread_mutex_t *mutex);
+     int __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *mutex);
+
+     int __gthread_mutex_lock (__gthread_mutex_t *mutex);
+     int __gthread_mutex_trylock (__gthread_mutex_t *mutex);
+     int __gthread_mutex_unlock (__gthread_mutex_t *mutex);
+
+     int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex);
+     int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex);
+     int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex);
+
+   The following are supported in POSIX threads only. They are required to
+   fix a deadlock in static initialization inside libsupc++. The header file
+   gthr-posix.h defines a symbol __GTHREAD_HAS_COND to signify that these extra
+   features are supported.
+
+   Types:
+     __gthread_cond_t
+
+   Macros:
+     __GTHREAD_COND_INIT
+     __GTHREAD_COND_INIT_FUNCTION
+
+   Interface:
+     int __gthread_cond_broadcast (__gthread_cond_t *cond);
+     int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex);
+     int __gthread_cond_wait_recursive (__gthread_cond_t *cond,
+					__gthread_recursive_mutex_t *mutex);
+
+   All functions returning int should return zero on success or the error
+   number.  If the operation is not supported, -1 is returned.
+
+   If the following are also defined, you should
+     #define __GTHREADS_CXX0X 1
+   to enable the c++0x thread library.
+
+   Types:
+     __gthread_t
+     __gthread_time_t
+
+   Interface:
+     int __gthread_create (__gthread_t *thread, void *(*func) (void*),
+                           void *args);
+     int __gthread_join (__gthread_t thread, void **value_ptr);
+     int __gthread_detach (__gthread_t thread);
+     int __gthread_equal (__gthread_t t1, __gthread_t t2);
+     __gthread_t __gthread_self (void);
+     int __gthread_yield (void);
+
+     int __gthread_mutex_timedlock (__gthread_mutex_t *m,
+                                    const __gthread_time_t *abs_timeout);
+     int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m,
+                                          const __gthread_time_t *abs_time);
+
+     int __gthread_cond_signal (__gthread_cond_t *cond);
+     int __gthread_cond_timedwait (__gthread_cond_t *cond,
+                                   __gthread_mutex_t *mutex,
+                                   const __gthread_time_t *abs_timeout);
+
+*/
+
+#if __GXX_WEAK__
+/* The pe-coff weak support isn't fully compatible to ELF's weak.
+   For static libraries it might would work, but as we need to deal
+   with shared versions too, we disable it for mingw-targets.  */
+#ifdef __MINGW32__
+#undef _GLIBCXX_GTHREAD_USE_WEAK
+#define _GLIBCXX_GTHREAD_USE_WEAK 0
+#endif
+
+#ifndef _GLIBCXX_GTHREAD_USE_WEAK
+#define _GLIBCXX_GTHREAD_USE_WEAK 1
+#endif
+#endif
+#include <bits/gthr-default.h>
+
+#ifndef _GLIBCXX_HIDE_EXPORTS
+#pragma GCC visibility pop
+#endif
+
+#endif /* ! _GLIBCXX_GCC_GTHR_H */

+ 151 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/messages_members.h

@@ -0,0 +1,151 @@
+// std::messages implementation details, GNU version -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/messages_members.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.2.7.1.2  messages functions
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#include <libintl.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Non-virtual member functions.
+  template<typename _CharT>
+    messages<_CharT>::messages(size_t __refs)
+    : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
+      _M_name_messages(_S_get_c_name())
+    { }
+
+  template<typename _CharT>
+    messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+			       size_t __refs)
+    : facet(__refs), _M_c_locale_messages(0), _M_name_messages(0)
+    {
+      if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
+	{
+	  const size_t __len = __builtin_strlen(__s) + 1;
+	  char* __tmp = new char[__len];
+	  __builtin_memcpy(__tmp, __s, __len);
+	  _M_name_messages = __tmp;
+	}
+      else
+	_M_name_messages = _S_get_c_name();
+
+      // Last to avoid leaking memory if new throws.
+      _M_c_locale_messages = _S_clone_c_locale(__cloc);
+    }
+
+  template<typename _CharT>
+    typename messages<_CharT>::catalog
+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+			   const char* __dir) const
+    {
+      bindtextdomain(__s.c_str(), __dir);
+      return this->do_open(__s, __loc);
+    }
+
+  // Virtual member functions.
+  template<typename _CharT>
+    messages<_CharT>::~messages()
+    {
+      if (_M_name_messages != _S_get_c_name())
+	delete [] _M_name_messages;
+      _S_destroy_c_locale(_M_c_locale_messages);
+    }
+
+  template<typename _CharT>
+    typename messages<_CharT>::catalog
+    messages<_CharT>::do_open(const basic_string<char>& __s,
+			      const locale&) const
+    {
+      // No error checking is done, assume the catalog exists and can
+      // be used.
+      textdomain(__s.c_str());
+      return 0;
+    }
+
+  template<typename _CharT>
+    void
+    messages<_CharT>::do_close(catalog) const
+    { }
+
+  // messages_byname
+  template<typename _CharT>
+    messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
+    : messages<_CharT>(__refs)
+    {
+      if (this->_M_name_messages != locale::facet::_S_get_c_name())
+	{
+	  delete [] this->_M_name_messages;
+	  if (__builtin_strcmp(__s, locale::facet::_S_get_c_name()) != 0)
+	    {
+	      const size_t __len = __builtin_strlen(__s) + 1;
+	      char* __tmp = new char[__len];
+	      __builtin_memcpy(__tmp, __s, __len);
+	      this->_M_name_messages = __tmp;
+	    }
+	  else
+	    this->_M_name_messages = locale::facet::_S_get_c_name();
+	}
+
+      if (__builtin_strcmp(__s, "C") != 0
+	  && __builtin_strcmp(__s, "POSIX") != 0)
+	{
+	  this->_S_destroy_c_locale(this->_M_c_locale_messages);
+	  this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+	}
+    }
+
+   //Specializations.
+  template<>
+    typename messages<char>::catalog
+    messages<char>::do_open(const basic_string<char>&,
+			    const locale&) const;
+
+  template<>
+    void
+    messages<char>::do_close(catalog) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    typename messages<wchar_t>::catalog
+    messages<wchar_t>::do_open(const basic_string<char>&,
+			       const locale&) const;
+
+  template<>
+    void
+    messages<wchar_t>::do_close(catalog) const;
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

+ 38 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/opt_random.h

@@ -0,0 +1,38 @@
+// Optimizations for random number handling, generic version -*- C++ -*-
+
+// Copyright (C) 2012-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/opt_random.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{random}
+ */
+
+#ifndef _BITS_OPT_RANDOM_H
+#define _BITS_OPT_RANDOM_H 1
+
+#pragma GCC system_header
+
+
+
+
+#endif // _BITS_OPT_RANDOM_H

+ 52 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/os_defines.h

@@ -0,0 +1,52 @@
+// Specific definitions for GNU/Linux  -*- C++ -*-
+
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/os_defines.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _GLIBCXX_OS_DEFINES
+#define _GLIBCXX_OS_DEFINES 1
+
+// System-specific #define, typedefs, corrections, etc, go here.  This
+// file will come before all others.
+
+// This keeps isanum, et al from being propagated as macros.
+#define __NO_CTYPE 1
+
+#include <features.h>
+
+// Provide a declaration for the possibly deprecated gets function, as
+// glibc 2.15 and later does not declare gets for ISO C11 when
+// __GNU_SOURCE is defined.
+#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
+# undef _GLIBCXX_HAVE_GETS
+#endif
+
+// Glibc 2.23 removed the obsolete isinf and isnan declarations. Check the
+// version dynamically in case it has changed since libstdc++ was configured.
+#define _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC __GLIBC_PREREQ(2,23)
+
+#endif

+ 123 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/stdc++.h

@@ -0,0 +1,123 @@
+// C++ includes used for precompiling -*- C++ -*-
+
+// Copyright (C) 2003-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdc++.h
+ *  This is an implementation file for a precompiled header.
+ */
+
+// 17.4.1.2 Headers
+
+// C
+#ifndef _GLIBCXX_NO_ASSERT
+#include <cassert>
+#endif
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#if __cplusplus >= 201103L
+#include <ccomplex>
+#include <cfenv>
+#include <cinttypes>
+#include <cstdalign>
+#include <cstdbool>
+#include <cstdint>
+#include <ctgmath>
+#include <cuchar>
+#include <cwchar>
+#include <cwctype>
+#endif
+
+// C++
+#include <algorithm>
+#include <bitset>
+#include <complex>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <iostream>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
+
+#if __cplusplus >= 201103L
+#include <array>
+#include <atomic>
+#include <chrono>
+#include <codecvt>
+#include <condition_variable>
+#include <forward_list>
+#include <future>
+#include <initializer_list>
+#include <mutex>
+#include <random>
+#include <ratio>
+#include <regex>
+#include <scoped_allocator>
+#include <system_error>
+#include <thread>
+#include <tuple>
+#include <typeindex>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
+#endif
+
+#if __cplusplus >= 201402L
+#include <shared_mutex>
+#endif

+ 53 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/stdtr1c++.h

@@ -0,0 +1,53 @@
+// C++ includes used for precompiling TR1 -*- C++ -*-
+
+// Copyright (C) 2006-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdtr1c++.h
+ *  This is an implementation file for a precompiled header.
+ */
+
+#include <bits/stdc++.h>
+
+#include <tr1/array>
+#include <tr1/cctype>
+#include <tr1/cfenv>
+#include <tr1/cfloat>
+#include <tr1/cinttypes>
+#include <tr1/climits>
+#include <tr1/cmath>
+#include <tr1/complex>
+#include <tr1/cstdarg>
+#include <tr1/cstdbool>
+#include <tr1/cstdint>
+#include <tr1/cstdio>
+#include <tr1/cstdlib>
+#include <tr1/ctgmath>
+#include <tr1/ctime>
+#include <tr1/cwchar>
+#include <tr1/cwctype>
+#include <tr1/functional>
+#include <tr1/random>
+#include <tr1/tuple>
+#include <tr1/unordered_map>
+#include <tr1/unordered_set>
+#include <tr1/utility>

+ 89 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/bits/time_members.h

@@ -0,0 +1,89 @@
+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/time_members.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _CharT>
+    __timepunct<_CharT>::__timepunct(size_t __refs)
+    : facet(__refs), _M_data(0), _M_c_locale_timepunct(0),
+      _M_name_timepunct(_S_get_c_name())
+    { _M_initialize_timepunct(); }
+
+  template<typename _CharT>
+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(0),
+      _M_name_timepunct(_S_get_c_name())
+    { _M_initialize_timepunct(); }
+
+  template<typename _CharT>
+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+				     size_t __refs)
+    : facet(__refs), _M_data(0), _M_c_locale_timepunct(0),
+      _M_name_timepunct(0)
+    {
+      if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
+	{
+	  const size_t __len = __builtin_strlen(__s) + 1;
+	  char* __tmp = new char[__len];
+	  __builtin_memcpy(__tmp, __s, __len);
+	  _M_name_timepunct = __tmp;
+	}
+      else
+	_M_name_timepunct = _S_get_c_name();
+
+      __try
+	{ _M_initialize_timepunct(__cloc); }
+      __catch(...)
+	{
+	  if (_M_name_timepunct != _S_get_c_name())
+	    delete [] _M_name_timepunct;
+	  __throw_exception_again;
+	}
+    }
+
+  template<typename _CharT>
+    __timepunct<_CharT>::~__timepunct()
+    {
+      if (_M_name_timepunct != _S_get_c_name())
+	delete [] _M_name_timepunct;
+      delete _M_data;
+      _S_destroy_c_locale(_M_c_locale_timepunct);
+    }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

+ 38 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/arm-linux-gnueabihf/ext/opt_random.h

@@ -0,0 +1,38 @@
+// Optimizations for random number extensions, generic version -*- C++ -*-
+
+// Copyright (C) 2012-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/opt_random.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ext/random}
+ */
+
+#ifndef _EXT_OPT_RANDOM_H
+#define _EXT_OPT_RANDOM_H 1
+
+#pragma GCC system_header
+
+
+
+
+#endif // _EXT_OPT_RANDOM_H

+ 378 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/array

@@ -0,0 +1,378 @@
+// <array> -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/array
+ *  This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ARRAY
+#define _GLIBCXX_ARRAY 1
+
+#pragma GCC system_header
+
+#if __cplusplus < 201103L
+# include <bits/c++0x_warning.h>
+#else
+
+#include <utility>
+#include <stdexcept>
+#include <bits/stl_algobase.h>
+#include <bits/range_access.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+
+  template<typename _Tp, std::size_t _Nm>
+    struct __array_traits
+    {
+      typedef _Tp _Type[_Nm];
+      typedef __is_swappable<_Tp> _Is_swappable;
+      typedef __is_nothrow_swappable<_Tp> _Is_nothrow_swappable;
+
+      static constexpr _Tp&
+      _S_ref(const _Type& __t, std::size_t __n) noexcept
+      { return const_cast<_Tp&>(__t[__n]); }
+
+      static constexpr _Tp*
+      _S_ptr(const _Type& __t) noexcept
+      { return const_cast<_Tp*>(__t); }
+    };
+
+ template<typename _Tp>
+   struct __array_traits<_Tp, 0>
+   {
+     struct _Type { };
+     typedef true_type _Is_swappable;
+     typedef true_type _Is_nothrow_swappable;
+
+     static constexpr _Tp&
+     _S_ref(const _Type&, std::size_t) noexcept
+     { return *static_cast<_Tp*>(nullptr); }
+
+     static constexpr _Tp*
+     _S_ptr(const _Type&) noexcept
+     { return nullptr; }
+   };
+
+  /**
+   *  @brief A standard container for storing a fixed size sequence of elements.
+   *
+   *  @ingroup sequences
+   *
+   *  Meets the requirements of a <a href="tables.html#65">container</a>, a
+   *  <a href="tables.html#66">reversible container</a>, and a
+   *  <a href="tables.html#67">sequence</a>.
+   *
+   *  Sets support random access iterators.
+   *
+   *  @tparam  Tp  Type of element. Required to be a complete type.
+   *  @tparam  N  Number of elements.
+  */
+  template<typename _Tp, std::size_t _Nm>
+    struct array
+    {
+      typedef _Tp 	    			      value_type;
+      typedef value_type*			      pointer;
+      typedef const value_type*                       const_pointer;
+      typedef value_type&                   	      reference;
+      typedef const value_type&             	      const_reference;
+      typedef value_type*          		      iterator;
+      typedef const value_type*			      const_iterator;
+      typedef std::size_t                    	      size_type;
+      typedef std::ptrdiff_t                   	      difference_type;
+      typedef std::reverse_iterator<iterator>	      reverse_iterator;
+      typedef std::reverse_iterator<const_iterator>   const_reverse_iterator;
+
+      // Support for zero-sized arrays mandatory.
+      typedef _GLIBCXX_STD_C::__array_traits<_Tp, _Nm> _AT_Type;
+      typename _AT_Type::_Type                         _M_elems;
+
+      // No explicit construct/copy/destroy for aggregate type.
+
+      // DR 776.
+      void
+      fill(const value_type& __u)
+      { std::fill_n(begin(), size(), __u); }
+
+      void
+      swap(array& __other)
+      noexcept(_AT_Type::_Is_nothrow_swappable::value)
+      { std::swap_ranges(begin(), end(), __other.begin()); }
+
+      // Iterators.
+      _GLIBCXX17_CONSTEXPR iterator
+      begin() noexcept
+      { return iterator(data()); }
+
+      _GLIBCXX17_CONSTEXPR const_iterator
+      begin() const noexcept
+      { return const_iterator(data()); }
+
+      _GLIBCXX17_CONSTEXPR iterator
+      end() noexcept
+      { return iterator(data() + _Nm); }
+
+      _GLIBCXX17_CONSTEXPR const_iterator
+      end() const noexcept
+      { return const_iterator(data() + _Nm); }
+
+      _GLIBCXX17_CONSTEXPR reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(end()); }
+
+      _GLIBCXX17_CONSTEXPR const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      _GLIBCXX17_CONSTEXPR reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(begin()); }
+
+      _GLIBCXX17_CONSTEXPR const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+      _GLIBCXX17_CONSTEXPR const_iterator
+      cbegin() const noexcept
+      { return const_iterator(data()); }
+
+      _GLIBCXX17_CONSTEXPR const_iterator
+      cend() const noexcept
+      { return const_iterator(data() + _Nm); }
+
+      _GLIBCXX17_CONSTEXPR const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      _GLIBCXX17_CONSTEXPR const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+      // Capacity.
+      constexpr size_type
+      size() const noexcept { return _Nm; }
+
+      constexpr size_type
+      max_size() const noexcept { return _Nm; }
+
+      constexpr bool
+      empty() const noexcept { return size() == 0; }
+
+      // Element access.
+      _GLIBCXX17_CONSTEXPR reference
+      operator[](size_type __n) noexcept
+      { return _AT_Type::_S_ref(_M_elems, __n); }
+
+      constexpr const_reference
+      operator[](size_type __n) const noexcept
+      { return _AT_Type::_S_ref(_M_elems, __n); }
+
+      _GLIBCXX17_CONSTEXPR reference
+      at(size_type __n)
+      {
+	if (__n >= _Nm)
+	  std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) "
+					    ">= _Nm (which is %zu)"),
+					__n, _Nm);
+	return _AT_Type::_S_ref(_M_elems, __n);
+      }
+
+      constexpr const_reference
+      at(size_type __n) const
+      {
+	// Result of conditional expression must be an lvalue so use
+	// boolean ? lvalue : (throw-expr, lvalue)
+	return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n)
+	  : (std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) "
+					       ">= _Nm (which is %zu)"),
+					   __n, _Nm),
+	     _AT_Type::_S_ref(_M_elems, 0));
+      }
+
+      _GLIBCXX17_CONSTEXPR reference
+      front() noexcept
+      { return *begin(); }
+
+      constexpr const_reference
+      front() const noexcept
+      { return _AT_Type::_S_ref(_M_elems, 0); }
+
+      _GLIBCXX17_CONSTEXPR reference
+      back() noexcept
+      { return _Nm ? *(end() - 1) : *end(); }
+
+      constexpr const_reference
+      back() const noexcept
+      {
+	return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1)
+ 	           : _AT_Type::_S_ref(_M_elems, 0);
+      }
+
+      _GLIBCXX17_CONSTEXPR pointer
+      data() noexcept
+      { return _AT_Type::_S_ptr(_M_elems); }
+
+      _GLIBCXX17_CONSTEXPR const_pointer
+      data() const noexcept
+      { return _AT_Type::_S_ptr(_M_elems); }
+    };
+
+#if __cpp_deduction_guides >= 201606
+  template<typename _Tp, typename... _Up>
+    array(_Tp, _Up...)
+      -> array<enable_if_t<(is_same_v<_Tp, _Up> && ...), _Tp>,
+	       1 + sizeof...(_Up)>;
+#endif
+
+  // Array comparisons.
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return std::equal(__one.begin(), __one.end(), __two.begin()); }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return !(__one == __two); }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
+    {
+      return std::lexicographical_compare(__a.begin(), __a.end(),
+					  __b.begin(), __b.end());
+    }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return __two < __one; }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return !(__one > __two); }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return !(__one < __two); }
+
+  // Specialized algorithms.
+  template<typename _Tp, std::size_t _Nm>
+    inline
+#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+    // Constrained free swap overload, see p0185r1
+    typename enable_if<
+      _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::_Is_swappable::value
+    >::type
+#else
+    void
+#endif
+    swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
+    noexcept(noexcept(__one.swap(__two)))
+    { __one.swap(__two); }
+
+#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+  template<typename _Tp, std::size_t _Nm>
+    typename enable_if<
+      !_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::_Is_swappable::value>::type
+    swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete;
+#endif
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr _Tp&
+    get(array<_Tp, _Nm>& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::
+	_S_ref(__arr._M_elems, _Int);
+    }
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr _Tp&&
+    get(array<_Tp, _Nm>&& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return std::move(_GLIBCXX_STD_C::get<_Int>(__arr));
+    }
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr const _Tp&
+    get(const array<_Tp, _Nm>& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::
+	_S_ref(__arr._M_elems, _Int);
+    }
+
+_GLIBCXX_END_NAMESPACE_CONTAINER
+} // namespace std
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Tuple interface to class template array.
+
+  /// tuple_size
+  template<typename _Tp>
+    class tuple_size;
+
+  /// Partial specialization for std::array
+  template<typename _Tp, std::size_t _Nm>
+    struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>>
+    : public integral_constant<std::size_t, _Nm> { };
+
+  /// tuple_element
+  template<std::size_t _Int, typename _Tp>
+    class tuple_element;
+
+  /// Partial specialization for std::array
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>>
+    {
+      static_assert(_Int < _Nm, "index is out of bounds");
+      typedef _Tp type;
+    };
+
+  template<typename _Tp, std::size_t _Nm>
+    struct __is_tuple_like_impl<_GLIBCXX_STD_C::array<_Tp, _Nm>> : true_type
+    { };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/array>
+#endif
+
+#ifdef _GLIBCXX_PROFILE
+# include <profile/array>
+#endif
+
+#endif // C++11
+
+#endif // _GLIBCXX_ARRAY

+ 1372 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/atomic

@@ -0,0 +1,1372 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/atomic
+ *  This is a Standard C++ Library header.
+ */
+
+// Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl.
+// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
+
+#ifndef _GLIBCXX_ATOMIC
+#define _GLIBCXX_ATOMIC 1
+
+#pragma GCC system_header
+
+#if __cplusplus < 201103L
+# include <bits/c++0x_warning.h>
+#else
+
+#include <bits/atomic_base.h>
+#include <bits/move.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @addtogroup atomics
+   * @{
+   */
+
+#if __cplusplus > 201402L
+# define __cpp_lib_atomic_is_always_lock_free 201603
+#endif
+
+  template<typename _Tp>
+    struct atomic;
+
+  /// atomic<bool>
+  // NB: No operators or fetch-operations for this type.
+  template<>
+  struct atomic<bool>
+  {
+  private:
+    __atomic_base<bool>	_M_base;
+
+  public:
+    atomic() noexcept = default;
+    ~atomic() noexcept = default;
+    atomic(const atomic&) = delete;
+    atomic& operator=(const atomic&) = delete;
+    atomic& operator=(const atomic&) volatile = delete;
+
+    constexpr atomic(bool __i) noexcept : _M_base(__i) { }
+
+    bool
+    operator=(bool __i) noexcept
+    { return _M_base.operator=(__i); }
+
+    bool
+    operator=(bool __i) volatile noexcept
+    { return _M_base.operator=(__i); }
+
+    operator bool() const noexcept
+    { return _M_base.load(); }
+
+    operator bool() const volatile noexcept
+    { return _M_base.load(); }
+
+    bool
+    is_lock_free() const noexcept { return _M_base.is_lock_free(); }
+
+    bool
+    is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); }
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_BOOL_LOCK_FREE == 2;
+#endif
+
+    void
+    store(bool __i, memory_order __m = memory_order_seq_cst) noexcept
+    { _M_base.store(__i, __m); }
+
+    void
+    store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept
+    { _M_base.store(__i, __m); }
+
+    bool
+    load(memory_order __m = memory_order_seq_cst) const noexcept
+    { return _M_base.load(__m); }
+
+    bool
+    load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+    { return _M_base.load(__m); }
+
+    bool
+    exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept
+    { return _M_base.exchange(__i, __m); }
+
+    bool
+    exchange(bool __i,
+	     memory_order __m = memory_order_seq_cst) volatile noexcept
+    { return _M_base.exchange(__i, __m); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+			  memory_order __m2) noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+			  memory_order __m2) volatile noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2,
+			  memory_order __m = memory_order_seq_cst) noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2,
+		     memory_order __m = memory_order_seq_cst) volatile noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+			    memory_order __m2) noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+			    memory_order __m2) volatile noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2,
+			    memory_order __m = memory_order_seq_cst) noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2,
+		    memory_order __m = memory_order_seq_cst) volatile noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+  };
+
+
+  /**
+   *  @brief Generic atomic type, primary class template.
+   *
+   *  @tparam _Tp  Type to be made atomic, must be trivally copyable.
+   */
+  template<typename _Tp>
+    struct atomic
+    {
+    private:
+      // Align 1/2/4/8/16-byte types to at least their size.
+      static constexpr int _S_min_alignment
+	= (sizeof(_Tp) & (sizeof(_Tp) - 1)) || sizeof(_Tp) > 16
+	? 0 : sizeof(_Tp);
+
+      static constexpr int _S_alignment
+        = _S_min_alignment > alignof(_Tp) ? _S_min_alignment : alignof(_Tp);
+
+      alignas(_S_alignment) _Tp _M_i;
+
+      static_assert(__is_trivially_copyable(_Tp),
+		    "std::atomic requires a trivially copyable type");
+
+      static_assert(sizeof(_Tp) > 0,
+		    "Incomplete or zero-sized types are not supported");
+
+    public:
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(_Tp __i) noexcept : _M_i(__i) { }
+
+      operator _Tp() const noexcept
+      { return load(); }
+
+      operator _Tp() const volatile noexcept
+      { return load(); }
+
+      _Tp
+      operator=(_Tp __i) noexcept
+      { store(__i); return __i; }
+
+      _Tp
+      operator=(_Tp __i) volatile noexcept
+      { store(__i); return __i; }
+
+      bool
+      is_lock_free() const noexcept
+      {
+	// Produce a fake, minimally aligned pointer.
+	return __atomic_is_lock_free(sizeof(_M_i),
+	    reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+      bool
+      is_lock_free() const volatile noexcept
+      {
+	// Produce a fake, minimally aligned pointer.
+	return __atomic_is_lock_free(sizeof(_M_i),
+	    reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+#if __cplusplus > 201402L
+      static constexpr bool is_always_lock_free
+	= __atomic_always_lock_free(sizeof(_M_i), 0);
+#endif
+
+      void
+      store(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
+      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
+
+      void
+      store(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept
+      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
+
+      _Tp
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      {
+	alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+	_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+	__atomic_load(std::__addressof(_M_i), __ptr, __m);
+	return *__ptr;
+      }
+
+      _Tp
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      {
+        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+	_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+	__atomic_load(std::__addressof(_M_i), __ptr, __m);
+	return *__ptr;
+      }
+
+      _Tp
+      exchange(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
+      {
+        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+	_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+	__atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
+			  __ptr, __m);
+	return *__ptr;
+      }
+
+      _Tp
+      exchange(_Tp __i,
+	       memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+	_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+	__atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
+			  __ptr, __m);
+	return *__ptr;
+      }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
+			    memory_order __f) noexcept
+      {
+	return __atomic_compare_exchange(std::__addressof(_M_i),
+					 std::__addressof(__e),
+					 std::__addressof(__i),
+					 true, __s, __f);
+      }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
+			    memory_order __f) volatile noexcept
+      {
+	return __atomic_compare_exchange(std::__addressof(_M_i),
+					 std::__addressof(__e),
+					 std::__addressof(__i),
+					 true, __s, __f);
+      }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i,
+			    memory_order __m = memory_order_seq_cst) noexcept
+      { return compare_exchange_weak(__e, __i, __m,
+                                     __cmpexch_failure_order(__m)); }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i,
+		     memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return compare_exchange_weak(__e, __i, __m,
+                                     __cmpexch_failure_order(__m)); }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
+			      memory_order __f) noexcept
+      {
+	return __atomic_compare_exchange(std::__addressof(_M_i),
+					 std::__addressof(__e),
+					 std::__addressof(__i),
+					 false, __s, __f);
+      }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
+			      memory_order __f) volatile noexcept
+      {
+	return __atomic_compare_exchange(std::__addressof(_M_i),
+					 std::__addressof(__e),
+					 std::__addressof(__i),
+					 false, __s, __f);
+      }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i,
+			       memory_order __m = memory_order_seq_cst) noexcept
+      { return compare_exchange_strong(__e, __i, __m,
+                                       __cmpexch_failure_order(__m)); }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i,
+		     memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return compare_exchange_strong(__e, __i, __m,
+                                       __cmpexch_failure_order(__m)); }
+    };
+
+
+  /// Partial specialization for pointer types.
+  template<typename _Tp>
+    struct atomic<_Tp*>
+    {
+      typedef _Tp* 			__pointer_type;
+      typedef __atomic_base<_Tp*>	__base_type;
+      __base_type			_M_b;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__pointer_type __p) noexcept : _M_b(__p) { }
+
+      operator __pointer_type() const noexcept
+      { return __pointer_type(_M_b); }
+
+      operator __pointer_type() const volatile noexcept
+      { return __pointer_type(_M_b); }
+
+      __pointer_type
+      operator=(__pointer_type __p) noexcept
+      { return _M_b.operator=(__p); }
+
+      __pointer_type
+      operator=(__pointer_type __p) volatile noexcept
+      { return _M_b.operator=(__p); }
+
+      __pointer_type
+      operator++(int) noexcept
+      { return _M_b++; }
+
+      __pointer_type
+      operator++(int) volatile noexcept
+      { return _M_b++; }
+
+      __pointer_type
+      operator--(int) noexcept
+      { return _M_b--; }
+
+      __pointer_type
+      operator--(int) volatile noexcept
+      { return _M_b--; }
+
+      __pointer_type
+      operator++() noexcept
+      { return ++_M_b; }
+
+      __pointer_type
+      operator++() volatile noexcept
+      { return ++_M_b; }
+
+      __pointer_type
+      operator--() noexcept
+      { return --_M_b; }
+
+      __pointer_type
+      operator--() volatile noexcept
+      { return --_M_b; }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) noexcept
+      { return _M_b.operator+=(__d); }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) volatile noexcept
+      { return _M_b.operator+=(__d); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) noexcept
+      { return _M_b.operator-=(__d); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) volatile noexcept
+      { return _M_b.operator-=(__d); }
+
+      bool
+      is_lock_free() const noexcept
+      { return _M_b.is_lock_free(); }
+
+      bool
+      is_lock_free() const volatile noexcept
+      { return _M_b.is_lock_free(); }
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_POINTER_LOCK_FREE == 2;
+#endif
+
+      void
+      store(__pointer_type __p,
+	    memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.store(__p, __m); }
+
+      void
+      store(__pointer_type __p,
+	    memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.store(__p, __m); }
+
+      __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      { return _M_b.load(__m); }
+
+      __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      { return _M_b.load(__m); }
+
+      __pointer_type
+      exchange(__pointer_type __p,
+	       memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.exchange(__p, __m); }
+
+      __pointer_type
+      exchange(__pointer_type __p,
+	       memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.exchange(__p, __m); }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+			    memory_order __m1, memory_order __m2) noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+			    memory_order __m1,
+			    memory_order __m2) volatile noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+			    memory_order __m = memory_order_seq_cst) noexcept
+      {
+	return compare_exchange_weak(__p1, __p2, __m,
+				     __cmpexch_failure_order(__m));
+      }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+		    memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	return compare_exchange_weak(__p1, __p2, __m,
+				     __cmpexch_failure_order(__m));
+      }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+			      memory_order __m1, memory_order __m2) noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+			      memory_order __m1,
+			      memory_order __m2) volatile noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+			      memory_order __m = memory_order_seq_cst) noexcept
+      {
+	return _M_b.compare_exchange_strong(__p1, __p2, __m,
+					    __cmpexch_failure_order(__m));
+      }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+		    memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	return _M_b.compare_exchange_strong(__p1, __p2, __m,
+					    __cmpexch_failure_order(__m));
+      }
+
+      __pointer_type
+      fetch_add(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.fetch_add(__d, __m); }
+
+      __pointer_type
+      fetch_add(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.fetch_add(__d, __m); }
+
+      __pointer_type
+      fetch_sub(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.fetch_sub(__d, __m); }
+
+      __pointer_type
+      fetch_sub(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.fetch_sub(__d, __m); }
+    };
+
+
+  /// Explicit specialization for char.
+  template<>
+    struct atomic<char> : __atomic_base<char>
+    {
+      typedef char 			__integral_type;
+      typedef __atomic_base<char> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for signed char.
+  template<>
+    struct atomic<signed char> : __atomic_base<signed char>
+    {
+      typedef signed char 		__integral_type;
+      typedef __atomic_base<signed char> 	__base_type;
+
+      atomic() noexcept= default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for unsigned char.
+  template<>
+    struct atomic<unsigned char> : __atomic_base<unsigned char>
+    {
+      typedef unsigned char 		__integral_type;
+      typedef __atomic_base<unsigned char> 	__base_type;
+
+      atomic() noexcept= default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for short.
+  template<>
+    struct atomic<short> : __atomic_base<short>
+    {
+      typedef short 			__integral_type;
+      typedef __atomic_base<short> 		__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for unsigned short.
+  template<>
+    struct atomic<unsigned short> : __atomic_base<unsigned short>
+    {
+      typedef unsigned short 	      	__integral_type;
+      typedef __atomic_base<unsigned short> 		__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for int.
+  template<>
+    struct atomic<int> : __atomic_base<int>
+    {
+      typedef int 			__integral_type;
+      typedef __atomic_base<int> 		__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for unsigned int.
+  template<>
+    struct atomic<unsigned int> : __atomic_base<unsigned int>
+    {
+      typedef unsigned int		__integral_type;
+      typedef __atomic_base<unsigned int> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for long.
+  template<>
+    struct atomic<long> : __atomic_base<long>
+    {
+      typedef long 			__integral_type;
+      typedef __atomic_base<long> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for unsigned long.
+  template<>
+    struct atomic<unsigned long> : __atomic_base<unsigned long>
+    {
+      typedef unsigned long 		__integral_type;
+      typedef __atomic_base<unsigned long> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for long long.
+  template<>
+    struct atomic<long long> : __atomic_base<long long>
+    {
+      typedef long long 		__integral_type;
+      typedef __atomic_base<long long> 		__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for unsigned long long.
+  template<>
+    struct atomic<unsigned long long> : __atomic_base<unsigned long long>
+    {
+      typedef unsigned long long       	__integral_type;
+      typedef __atomic_base<unsigned long long> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for wchar_t.
+  template<>
+    struct atomic<wchar_t> : __atomic_base<wchar_t>
+    {
+      typedef wchar_t 			__integral_type;
+      typedef __atomic_base<wchar_t> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_WCHAR_T_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for char16_t.
+  template<>
+    struct atomic<char16_t> : __atomic_base<char16_t>
+    {
+      typedef char16_t 			__integral_type;
+      typedef __atomic_base<char16_t> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_CHAR16_T_LOCK_FREE == 2;
+#endif
+    };
+
+  /// Explicit specialization for char32_t.
+  template<>
+    struct atomic<char32_t> : __atomic_base<char32_t>
+    {
+      typedef char32_t 			__integral_type;
+      typedef __atomic_base<char32_t> 	__base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+#if __cplusplus > 201402L
+    static constexpr bool is_always_lock_free = ATOMIC_CHAR32_T_LOCK_FREE == 2;
+#endif
+    };
+
+
+  /// atomic_bool
+  typedef atomic<bool>			atomic_bool;
+
+  /// atomic_char
+  typedef atomic<char>			atomic_char;
+
+  /// atomic_schar
+  typedef atomic<signed char>		atomic_schar;
+
+  /// atomic_uchar
+  typedef atomic<unsigned char>		atomic_uchar;
+
+  /// atomic_short
+  typedef atomic<short>			atomic_short;
+
+  /// atomic_ushort
+  typedef atomic<unsigned short>	atomic_ushort;
+
+  /// atomic_int
+  typedef atomic<int>			atomic_int;
+
+  /// atomic_uint
+  typedef atomic<unsigned int>		atomic_uint;
+
+  /// atomic_long
+  typedef atomic<long>			atomic_long;
+
+  /// atomic_ulong
+  typedef atomic<unsigned long>		atomic_ulong;
+
+  /// atomic_llong
+  typedef atomic<long long>		atomic_llong;
+
+  /// atomic_ullong
+  typedef atomic<unsigned long long>	atomic_ullong;
+
+  /// atomic_wchar_t
+  typedef atomic<wchar_t>		atomic_wchar_t;
+
+  /// atomic_char16_t
+  typedef atomic<char16_t>		atomic_char16_t;
+
+  /// atomic_char32_t
+  typedef atomic<char32_t>		atomic_char32_t;
+
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 2441. Exact-width atomic typedefs should be provided
+
+  /// atomic_int8_t
+  typedef atomic<int8_t>		atomic_int8_t;
+
+  /// atomic_uint8_t
+  typedef atomic<uint8_t>		atomic_uint8_t;
+
+  /// atomic_int16_t
+  typedef atomic<int16_t>		atomic_int16_t;
+
+  /// atomic_uint16_t
+  typedef atomic<uint16_t>		atomic_uint16_t;
+
+  /// atomic_int32_t
+  typedef atomic<int32_t>		atomic_int32_t;
+
+  /// atomic_uint32_t
+  typedef atomic<uint32_t>		atomic_uint32_t;
+
+  /// atomic_int64_t
+  typedef atomic<int64_t>		atomic_int64_t;
+
+  /// atomic_uint64_t
+  typedef atomic<uint64_t>		atomic_uint64_t;
+
+
+  /// atomic_int_least8_t
+  typedef atomic<int_least8_t>		atomic_int_least8_t;
+
+  /// atomic_uint_least8_t
+  typedef atomic<uint_least8_t>		atomic_uint_least8_t;
+
+  /// atomic_int_least16_t
+  typedef atomic<int_least16_t>		atomic_int_least16_t;
+
+  /// atomic_uint_least16_t
+  typedef atomic<uint_least16_t>	atomic_uint_least16_t;
+
+  /// atomic_int_least32_t
+  typedef atomic<int_least32_t>		atomic_int_least32_t;
+
+  /// atomic_uint_least32_t
+  typedef atomic<uint_least32_t>	atomic_uint_least32_t;
+
+  /// atomic_int_least64_t
+  typedef atomic<int_least64_t>		atomic_int_least64_t;
+
+  /// atomic_uint_least64_t
+  typedef atomic<uint_least64_t>	atomic_uint_least64_t;
+
+
+  /// atomic_int_fast8_t
+  typedef atomic<int_fast8_t>		atomic_int_fast8_t;
+
+  /// atomic_uint_fast8_t
+  typedef atomic<uint_fast8_t>		atomic_uint_fast8_t;
+
+  /// atomic_int_fast16_t
+  typedef atomic<int_fast16_t>		atomic_int_fast16_t;
+
+  /// atomic_uint_fast16_t
+  typedef atomic<uint_fast16_t>		atomic_uint_fast16_t;
+
+  /// atomic_int_fast32_t
+  typedef atomic<int_fast32_t>		atomic_int_fast32_t;
+
+  /// atomic_uint_fast32_t
+  typedef atomic<uint_fast32_t>		atomic_uint_fast32_t;
+
+  /// atomic_int_fast64_t
+  typedef atomic<int_fast64_t>		atomic_int_fast64_t;
+
+  /// atomic_uint_fast64_t
+  typedef atomic<uint_fast64_t>		atomic_uint_fast64_t;
+
+
+  /// atomic_intptr_t
+  typedef atomic<intptr_t>		atomic_intptr_t;
+
+  /// atomic_uintptr_t
+  typedef atomic<uintptr_t>		atomic_uintptr_t;
+
+  /// atomic_size_t
+  typedef atomic<size_t>		atomic_size_t;
+
+  /// atomic_intmax_t
+  typedef atomic<intmax_t>		atomic_intmax_t;
+
+  /// atomic_uintmax_t
+  typedef atomic<uintmax_t>		atomic_uintmax_t;
+
+  /// atomic_ptrdiff_t
+  typedef atomic<ptrdiff_t>		atomic_ptrdiff_t;
+
+
+  // Function definitions, atomic_flag operations.
+  inline bool
+  atomic_flag_test_and_set_explicit(atomic_flag* __a,
+				    memory_order __m) noexcept
+  { return __a->test_and_set(__m); }
+
+  inline bool
+  atomic_flag_test_and_set_explicit(volatile atomic_flag* __a,
+				    memory_order __m) noexcept
+  { return __a->test_and_set(__m); }
+
+  inline void
+  atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept
+  { __a->clear(__m); }
+
+  inline void
+  atomic_flag_clear_explicit(volatile atomic_flag* __a,
+			     memory_order __m) noexcept
+  { __a->clear(__m); }
+
+  inline bool
+  atomic_flag_test_and_set(atomic_flag* __a) noexcept
+  { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+
+  inline bool
+  atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept
+  { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+
+  inline void
+  atomic_flag_clear(atomic_flag* __a) noexcept
+  { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+
+  inline void
+  atomic_flag_clear(volatile atomic_flag* __a) noexcept
+  { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+
+
+  // Function templates generally applicable to atomic types.
+  template<typename _ITp>
+    inline bool
+    atomic_is_lock_free(const atomic<_ITp>* __a) noexcept
+    { return __a->is_lock_free(); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept
+    { return __a->is_lock_free(); }
+
+  template<typename _ITp>
+    inline void
+    atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept
+    { __a->store(__i, memory_order_relaxed); }
+
+  template<typename _ITp>
+    inline void
+    atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+    { __a->store(__i, memory_order_relaxed); }
+
+  template<typename _ITp>
+    inline void
+    atomic_store_explicit(atomic<_ITp>* __a, _ITp __i,
+			  memory_order __m) noexcept
+    { __a->store(__i, __m); }
+
+  template<typename _ITp>
+    inline void
+    atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i,
+			  memory_order __m) noexcept
+    { __a->store(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept
+    { return __a->load(__m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load_explicit(const volatile atomic<_ITp>* __a,
+			 memory_order __m) noexcept
+    { return __a->load(__m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i,
+			     memory_order __m) noexcept
+    { return __a->exchange(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i,
+			     memory_order __m) noexcept
+    { return __a->exchange(__i, __m); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a,
+					  _ITp* __i1, _ITp __i2,
+					  memory_order __m1,
+					  memory_order __m2) noexcept
+    { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a,
+					  _ITp* __i1, _ITp __i2,
+					  memory_order __m1,
+					  memory_order __m2) noexcept
+    { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a,
+					    _ITp* __i1, _ITp __i2,
+					    memory_order __m1,
+					    memory_order __m2) noexcept
+    { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a,
+					    _ITp* __i1, _ITp __i2,
+					    memory_order __m1,
+					    memory_order __m2) noexcept
+    { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+
+  template<typename _ITp>
+    inline void
+    atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept
+    { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline void
+    atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+    { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load(const atomic<_ITp>* __a) noexcept
+    { return atomic_load_explicit(__a, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load(const volatile atomic<_ITp>* __a) noexcept
+    { return atomic_load_explicit(__a, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak(atomic<_ITp>* __a,
+				 _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
+						   memory_order_seq_cst,
+						   memory_order_seq_cst);
+    }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak(volatile atomic<_ITp>* __a,
+				 _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
+						   memory_order_seq_cst,
+						   memory_order_seq_cst);
+    }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong(atomic<_ITp>* __a,
+				   _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
+						     memory_order_seq_cst,
+						     memory_order_seq_cst);
+    }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong(volatile atomic<_ITp>* __a,
+				   _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
+						     memory_order_seq_cst,
+						     memory_order_seq_cst);
+    }
+
+  // Function templates for atomic_integral operations only, using
+  // __atomic_base. Template argument should be constricted to
+  // intergral types as specified in the standard, excluding address
+  // types.
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_add(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_add(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_sub(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_sub(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_and(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_and(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+			     memory_order __m) noexcept
+    { return __a->fetch_or(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+			     memory_order __m) noexcept
+    { return __a->fetch_or(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_xor(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+			      memory_order __m) noexcept
+    { return __a->fetch_xor(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+
+
+  // Partial specializations for pointers.
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
+			      memory_order __m) noexcept
+    { return __a->fetch_add(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d,
+			      memory_order __m) noexcept
+    { return __a->fetch_add(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_add(__d); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_add(__d); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a,
+			      ptrdiff_t __d, memory_order __m) noexcept
+    { return __a->fetch_sub(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
+			      memory_order __m) noexcept
+    { return __a->fetch_sub(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_sub(__d); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_sub(__d); }
+  // @} group atomics
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif // C++11
+
+#endif // _GLIBCXX_ATOMIC

+ 333 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/auto_ptr.h

@@ -0,0 +1,333 @@
+// auto_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file backward/auto_ptr.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{memory}
+ */
+
+#ifndef _BACKWARD_AUTO_PTR_H
+#define _BACKWARD_AUTO_PTR_H 1
+
+#include <bits/c++config.h>
+#include <debug/debug.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  A wrapper class to provide auto_ptr with reference semantics.
+   *  For example, an auto_ptr can be assigned (or constructed from)
+   *  the result of a function which returns an auto_ptr by value.
+   *
+   *  All the auto_ptr_ref stuff should happen behind the scenes.
+   */
+  template<typename _Tp1>
+    struct auto_ptr_ref
+    {
+      _Tp1* _M_ptr;
+      
+      explicit
+      auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
+    } _GLIBCXX_DEPRECATED;
+
+
+  /**
+   *  @brief  A simple smart pointer providing strict ownership semantics.
+   *
+   *  The Standard says:
+   *  <pre>
+   *  An @c auto_ptr owns the object it holds a pointer to.  Copying
+   *  an @c auto_ptr copies the pointer and transfers ownership to the
+   *  destination.  If more than one @c auto_ptr owns the same object
+   *  at the same time the behavior of the program is undefined.
+   *
+   *  The uses of @c auto_ptr include providing temporary
+   *  exception-safety for dynamically allocated memory, passing
+   *  ownership of dynamically allocated memory to a function, and
+   *  returning dynamically allocated memory from a function.  @c
+   *  auto_ptr does not meet the CopyConstructible and Assignable
+   *  requirements for Standard Library <a
+   *  href="tables.html#65">container</a> elements and thus
+   *  instantiating a Standard Library container with an @c auto_ptr
+   *  results in undefined behavior.
+   *  </pre>
+   *  Quoted from [20.4.5]/3.
+   *
+   *  Good examples of what can and cannot be done with auto_ptr can
+   *  be found in the libstdc++ testsuite.
+   *
+   *  _GLIBCXX_RESOLVE_LIB_DEFECTS
+   *  127.  auto_ptr<> conversion issues
+   *  These resolutions have all been incorporated.
+   */
+  template<typename _Tp>
+    class auto_ptr
+    {
+    private:
+      _Tp* _M_ptr;
+      
+    public:
+      /// The pointed-to type.
+      typedef _Tp element_type;
+      
+      /**
+       *  @brief  An %auto_ptr is usually constructed from a raw pointer.
+       *  @param  __p  A pointer (defaults to NULL).
+       *
+       *  This object now @e owns the object pointed to by @a __p.
+       */
+      explicit
+      auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
+
+      /**
+       *  @brief  An %auto_ptr can be constructed from another %auto_ptr.
+       *  @param  __a  Another %auto_ptr of the same type.
+       *
+       *  This object now @e owns the object previously owned by @a __a,
+       *  which has given up ownership.
+       */
+      auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
+
+      /**
+       *  @brief  An %auto_ptr can be constructed from another %auto_ptr.
+       *  @param  __a  Another %auto_ptr of a different but related type.
+       *
+       *  A pointer-to-Tp1 must be convertible to a
+       *  pointer-to-Tp/element_type.
+       *
+       *  This object now @e owns the object previously owned by @a __a,
+       *  which has given up ownership.
+       */
+      template<typename _Tp1>
+        auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
+
+      /**
+       *  @brief  %auto_ptr assignment operator.
+       *  @param  __a  Another %auto_ptr of the same type.
+       *
+       *  This object now @e owns the object previously owned by @a __a,
+       *  which has given up ownership.  The object that this one @e
+       *  used to own and track has been deleted.
+       */
+      auto_ptr&
+      operator=(auto_ptr& __a) throw()
+      {
+	reset(__a.release());
+	return *this;
+      }
+
+      /**
+       *  @brief  %auto_ptr assignment operator.
+       *  @param  __a  Another %auto_ptr of a different but related type.
+       *
+       *  A pointer-to-Tp1 must be convertible to a pointer-to-Tp/element_type.
+       *
+       *  This object now @e owns the object previously owned by @a __a,
+       *  which has given up ownership.  The object that this one @e
+       *  used to own and track has been deleted.
+       */
+      template<typename _Tp1>
+        auto_ptr&
+        operator=(auto_ptr<_Tp1>& __a) throw()
+        {
+	  reset(__a.release());
+	  return *this;
+	}
+
+      /**
+       *  When the %auto_ptr goes out of scope, the object it owns is
+       *  deleted.  If it no longer owns anything (i.e., @c get() is
+       *  @c NULL), then this has no effect.
+       *
+       *  The C++ standard says there is supposed to be an empty throw
+       *  specification here, but omitting it is standard conforming.  Its
+       *  presence can be detected only if _Tp::~_Tp() throws, but this is
+       *  prohibited.  [17.4.3.6]/2
+       */
+      ~auto_ptr() { delete _M_ptr; }
+      
+      /**
+       *  @brief  Smart pointer dereferencing.
+       *
+       *  If this %auto_ptr no longer owns anything, then this
+       *  operation will crash.  (For a smart pointer, <em>no longer owns
+       *  anything</em> is the same as being a null pointer, and you know
+       *  what happens when you dereference one of those...)
+       */
+      element_type&
+      operator*() const throw() 
+      {
+	__glibcxx_assert(_M_ptr != 0);
+	return *_M_ptr; 
+      }
+      
+      /**
+       *  @brief  Smart pointer dereferencing.
+       *
+       *  This returns the pointer itself, which the language then will
+       *  automatically cause to be dereferenced.
+       */
+      element_type*
+      operator->() const throw() 
+      {
+	__glibcxx_assert(_M_ptr != 0);
+	return _M_ptr; 
+      }
+      
+      /**
+       *  @brief  Bypassing the smart pointer.
+       *  @return  The raw pointer being managed.
+       *
+       *  You can get a copy of the pointer that this object owns, for
+       *  situations such as passing to a function which only accepts
+       *  a raw pointer.
+       *
+       *  @note  This %auto_ptr still owns the memory.
+       */
+      element_type*
+      get() const throw() { return _M_ptr; }
+      
+      /**
+       *  @brief  Bypassing the smart pointer.
+       *  @return  The raw pointer being managed.
+       *
+       *  You can get a copy of the pointer that this object owns, for
+       *  situations such as passing to a function which only accepts
+       *  a raw pointer.
+       *
+       *  @note  This %auto_ptr no longer owns the memory.  When this object
+       *  goes out of scope, nothing will happen.
+       */
+      element_type*
+      release() throw()
+      {
+	element_type* __tmp = _M_ptr;
+	_M_ptr = 0;
+	return __tmp;
+      }
+      
+      /**
+       *  @brief  Forcibly deletes the managed object.
+       *  @param  __p  A pointer (defaults to NULL).
+       *
+       *  This object now @e owns the object pointed to by @a __p.  The
+       *  previous object has been deleted.
+       */
+      void
+      reset(element_type* __p = 0) throw()
+      {
+	if (__p != _M_ptr)
+	  {
+	    delete _M_ptr;
+	    _M_ptr = __p;
+	  }
+      }
+      
+      /** 
+       *  @brief  Automatic conversions
+       *
+       *  These operations are supposed to convert an %auto_ptr into and from
+       *  an auto_ptr_ref automatically as needed.  This would allow
+       *  constructs such as
+       *  @code
+       *    auto_ptr<Derived>  func_returning_auto_ptr(.....);
+       *    ...
+       *    auto_ptr<Base> ptr = func_returning_auto_ptr(.....);
+       *  @endcode
+       *
+       *  But it doesn't work, and won't be fixed. For further details see
+       *  http://cplusplus.github.io/LWG/lwg-closed.html#463
+       */
+      auto_ptr(auto_ptr_ref<element_type> __ref) throw()
+      : _M_ptr(__ref._M_ptr) { }
+      
+      auto_ptr&
+      operator=(auto_ptr_ref<element_type> __ref) throw()
+      {
+	if (__ref._M_ptr != this->get())
+	  {
+	    delete _M_ptr;
+	    _M_ptr = __ref._M_ptr;
+	  }
+	return *this;
+      }
+      
+      template<typename _Tp1>
+        operator auto_ptr_ref<_Tp1>() throw()
+        { return auto_ptr_ref<_Tp1>(this->release()); }
+
+      template<typename _Tp1>
+        operator auto_ptr<_Tp1>() throw()
+        { return auto_ptr<_Tp1>(this->release()); }
+    } _GLIBCXX_DEPRECATED;
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 541. shared_ptr template assignment and void
+  template<>
+    class auto_ptr<void>
+    {
+    public:
+      typedef void element_type;
+    } _GLIBCXX_DEPRECATED;
+
+#if __cplusplus >= 201103L
+  template<_Lock_policy _Lp>
+  template<typename _Tp>
+    inline
+    __shared_count<_Lp>::__shared_count(std::auto_ptr<_Tp>&& __r)
+    : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
+    { __r.release(); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+  template<typename _Tp1, typename>
+    inline
+    __shared_ptr<_Tp, _Lp>::__shared_ptr(std::auto_ptr<_Tp1>&& __r)
+    : _M_ptr(__r.get()), _M_refcount()
+    {
+      __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+      static_assert( sizeof(_Tp1) > 0, "incomplete type" );
+      _Tp1* __tmp = __r.get();
+      _M_refcount = __shared_count<_Lp>(std::move(__r));
+      _M_enable_shared_from_this_with(__tmp);
+    }
+
+  template<typename _Tp>
+  template<typename _Tp1, typename>
+    inline
+    shared_ptr<_Tp>::shared_ptr(std::auto_ptr<_Tp1>&& __r)
+    : __shared_ptr<_Tp>(std::move(__r)) { }
+
+  template<typename _Tp, typename _Dp>
+  template<typename _Up, typename>
+    inline
+    unique_ptr<_Tp, _Dp>::unique_ptr(auto_ptr<_Up>&& __u) noexcept
+    : _M_t(__u.release(), deleter_type()) { }
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _BACKWARD_AUTO_PTR_H */

+ 60 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/backward_warning.h

@@ -0,0 +1,60 @@
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file backward/backward_warning.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _BACKWARD_BACKWARD_WARNING_H
+#define _BACKWARD_BACKWARD_WARNING_H 1
+
+#ifdef __DEPRECATED
+#warning \
+  This file includes at least one deprecated or antiquated header which \
+  may be removed without further notice at a future date. Please use a \
+  non-deprecated interface with equivalent functionality instead. For a \
+  listing of replacement headers and interfaces, consult the file \
+  backward_warning.h. To disable this warning use -Wno-deprecated.
+
+/*
+  A list of valid replacements is as follows:
+
+  Use:					Instead of:
+  <sstream>, basic_stringbuf	   	<strstream>, strstreambuf
+  <sstream>, basic_istringstream	<strstream>, istrstream
+  <sstream>, basic_ostringstream	<strstream>, ostrstream
+  <sstream>, basic_stringstream		<strstream>, strstream
+  <unordered_set>, unordered_set     	<ext/hash_set>, hash_set
+  <unordered_set>, unordered_multiset	<ext/hash_set>, hash_multiset
+  <unordered_map>, unordered_map	<ext/hash_map>, hash_map
+  <unordered_map>, unordered_multimap	<ext/hash_map>, hash_multimap
+  <functional>, bind			<functional>, binder1st
+  <functional>, bind			<functional>, binder2nd
+  <functional>, bind			<functional>, bind1st
+  <functional>, bind			<functional>, bind2nd
+  <memory>, unique_ptr       		<memory>, auto_ptr
+*/
+
+#endif
+
+#endif

+ 182 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/binders.h

@@ -0,0 +1,182 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file backward/binders.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{functional}
+ */
+
+#ifndef _BACKWARD_BINDERS_H
+#define _BACKWARD_BINDERS_H 1
+
+// Suppress deprecated warning for this file.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // 20.3.6 binders
+  /** @defgroup binders Binder Classes
+   * @ingroup functors
+   *
+   *  Binders turn functions/functors with two arguments into functors
+   *  with a single argument, storing an argument to be applied later.
+   *  For example, a variable @c B of type @c binder1st is constructed
+   *  from a functor @c f and an argument @c x. Later, B's @c
+   *  operator() is called with a single argument @c y. The return
+   *  value is the value of @c f(x,y). @c B can be @a called with
+   *  various arguments (y1, y2, ...) and will in turn call @c
+   *  f(x,y1), @c f(x,y2), ...
+   *
+   *  The function @c bind1st is provided to save some typing. It takes the
+   *  function and an argument as parameters, and returns an instance of
+   *  @c binder1st.
+   *
+   *  The type @c binder2nd and its creator function @c bind2nd do the same
+   *  thing, but the stored argument is passed as the second parameter instead
+   *  of the first, e.g., @c bind2nd(std::minus<float>(),1.3) will create a
+   *  functor whose @c operator() accepts a floating-point number, subtracts
+   *  1.3 from it, and returns the result. (If @c bind1st had been used,
+   *  the functor would perform <em>1.3 - x</em> instead.
+   *
+   *  Creator-wrapper functions like @c bind1st are intended to be used in
+   *  calling algorithms. Their return values will be temporary objects.
+   *  (The goal is to not require you to type names like
+   *  @c std::binder1st<std::plus<int>> for declaring a variable to hold the
+   *  return value from @c bind1st(std::plus<int>(),5).
+   *
+   *  These become more useful when combined with the composition functions.
+   *
+   *  These functions are deprecated in C++11 and can be replaced by
+   *  @c std::bind (or @c std::tr1::bind) which is more powerful and flexible,
+   *  supporting functions with any number of arguments.  Uses of @c bind1st
+   *  can be replaced by @c std::bind(f, x, std::placeholders::_1) and
+   *  @c bind2nd by @c std::bind(f, std::placeholders::_1, x).
+   *  @{
+   */
+  /// One of the @link binders binder functors@endlink.
+  template<typename _Operation>
+    class binder1st
+    : public unary_function<typename _Operation::second_argument_type,
+			    typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::first_argument_type value;
+
+    public:
+      binder1st(const _Operation& __x,
+		const typename _Operation::first_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 109.  Missing binders for non-const sequence elements
+      typename _Operation::result_type
+      operator()(typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+    } _GLIBCXX_DEPRECATED;
+
+  /// One of the @link binders binder functors@endlink.
+  template<typename _Operation, typename _Tp>
+    inline binder1st<_Operation>
+    bind1st(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::first_argument_type _Arg1_type;
+      return binder1st<_Operation>(__fn, _Arg1_type(__x));
+    }
+
+  /// One of the @link binders binder functors@endlink.
+  template<typename _Operation>
+    class binder2nd
+    : public unary_function<typename _Operation::first_argument_type,
+			    typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::second_argument_type value;
+
+    public:
+      binder2nd(const _Operation& __x,
+		const typename _Operation::second_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 109.  Missing binders for non-const sequence elements
+      typename _Operation::result_type
+      operator()(typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+    } _GLIBCXX_DEPRECATED;
+
+  /// One of the @link binders binder functors@endlink.
+  template<typename _Operation, typename _Tp>
+    inline binder2nd<_Operation>
+    bind2nd(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::second_argument_type _Arg2_type;
+      return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+    } 
+  /** @}  */
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#pragma GCC diagnostic pop
+
+#endif /* _BACKWARD_BINDERS_H */

+ 170 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hash_fun.h

@@ -0,0 +1,170 @@
+// 'struct hash' from SGI -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_fun.h
+ *  This file is a GNU extension to the Standard C++ Library (possibly
+ *  containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _BACKWARD_HASH_FUN_H
+#define _BACKWARD_HASH_FUN_H 1
+
+#include <bits/c++config.h>
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  using std::size_t;
+
+  template<class _Key>
+    struct hash { };
+
+  inline size_t
+  __stl_hash_string(const char* __s)
+  {
+    unsigned long __h = 0;
+    for ( ; *__s; ++__s)
+      __h = 5 * __h + *__s;
+    return size_t(__h);
+  }
+
+  template<>
+    struct hash<char*>
+    {
+      size_t
+      operator()(const char* __s) const
+      { return __stl_hash_string(__s); }
+    };
+
+  template<>
+    struct hash<const char*>
+    {
+      size_t
+      operator()(const char* __s) const
+      { return __stl_hash_string(__s); }
+    };
+
+  template<>
+    struct hash<char>
+    { 
+      size_t
+      operator()(char __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<unsigned char>
+    { 
+      size_t
+      operator()(unsigned char __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<signed char>
+    {
+      size_t
+      operator()(unsigned char __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<short>
+    {
+      size_t
+      operator()(short __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<unsigned short>
+    {
+      size_t
+      operator()(unsigned short __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<int>
+    { 
+      size_t 
+      operator()(int __x) const 
+      { return __x; }
+    };
+
+  template<>
+    struct hash<unsigned int>
+    { 
+      size_t
+      operator()(unsigned int __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<long>
+    {
+      size_t
+      operator()(long __x) const
+      { return __x; }
+    };
+
+  template<>
+    struct hash<unsigned long>
+    {
+      size_t
+      operator()(unsigned long __x) const
+      { return __x; }
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 599 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hash_map

@@ -0,0 +1,599 @@
+// Hashing map implementation -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_map
+ *  This file is a GNU extension to the Standard C++ Library (possibly
+ *  containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _BACKWARD_HASH_MAP
+#define _BACKWARD_HASH_MAP 1
+
+#ifndef _GLIBCXX_PERMIT_BACKWARD_HASH
+#include "backward_warning.h"
+#endif
+
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  using std::equal_to;
+  using std::allocator;
+  using std::pair;
+  using std::_Select1st;
+
+  /**
+   *  This is an SGI extension.
+   *  @ingroup SGIextensions
+   *  @doctodo
+   */
+  template<class _Key, class _Tp, class _HashFn = hash<_Key>,
+	   class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> >
+    class hash_map
+    {
+    private:
+      typedef hashtable<pair<const _Key, _Tp>,_Key, _HashFn,
+			_Select1st<pair<const _Key, _Tp> >,
+			_EqualKey, _Alloc> _Ht;
+
+      _Ht _M_ht;
+
+    public:
+      typedef typename _Ht::key_type key_type;
+      typedef _Tp data_type;
+      typedef _Tp mapped_type;
+      typedef typename _Ht::value_type value_type;
+      typedef typename _Ht::hasher hasher;
+      typedef typename _Ht::key_equal key_equal;
+      
+      typedef typename _Ht::size_type size_type;
+      typedef typename _Ht::difference_type difference_type;
+      typedef typename _Ht::pointer pointer;
+      typedef typename _Ht::const_pointer const_pointer;
+      typedef typename _Ht::reference reference;
+      typedef typename _Ht::const_reference const_reference;
+      
+      typedef typename _Ht::iterator iterator;
+      typedef typename _Ht::const_iterator const_iterator;
+      
+      typedef typename _Ht::allocator_type allocator_type;
+      
+      hasher
+      hash_funct() const
+      { return _M_ht.hash_funct(); }
+
+      key_equal
+      key_eq() const
+      { return _M_ht.key_eq(); }
+
+      allocator_type
+      get_allocator() const
+      { return _M_ht.get_allocator(); }
+
+      hash_map()
+      : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+  
+      explicit
+      hash_map(size_type __n)
+      : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+      hash_map(size_type __n, const hasher& __hf)
+      : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+      hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
+	       const allocator_type& __a = allocator_type())
+      : _M_ht(__n, __hf, __eql, __a) {}
+
+      template<class _InputIterator>
+        hash_map(_InputIterator __f, _InputIterator __l)
+	: _M_ht(100, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_unique(__f, __l); }
+
+      template<class _InputIterator>
+        hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
+	: _M_ht(__n, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_unique(__f, __l); }
+
+      template<class _InputIterator>
+        hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+		 const hasher& __hf)
+	: _M_ht(__n, __hf, key_equal(), allocator_type())
+        { _M_ht.insert_unique(__f, __l); }
+
+      template<class _InputIterator>
+        hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+		 const hasher& __hf, const key_equal& __eql,
+		 const allocator_type& __a = allocator_type())
+	: _M_ht(__n, __hf, __eql, __a)
+        { _M_ht.insert_unique(__f, __l); }
+
+      size_type
+      size() const
+      { return _M_ht.size(); }
+      
+      size_type
+      max_size() const
+      { return _M_ht.max_size(); }
+      
+      bool
+      empty() const
+      { return _M_ht.empty(); }
+  
+      void
+      swap(hash_map& __hs)
+      { _M_ht.swap(__hs._M_ht); }
+
+      template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+        friend bool
+        operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
+		    const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
+
+      iterator
+      begin()
+      { return _M_ht.begin(); }
+
+      iterator
+      end()
+      { return _M_ht.end(); }
+
+      const_iterator
+      begin() const
+      { return _M_ht.begin(); }
+
+      const_iterator
+      end() const
+      { return _M_ht.end(); }
+
+      pair<iterator, bool>
+      insert(const value_type& __obj)
+      { return _M_ht.insert_unique(__obj); }
+
+      template<class _InputIterator>
+        void
+        insert(_InputIterator __f, _InputIterator __l)
+        { _M_ht.insert_unique(__f, __l); }
+
+      pair<iterator, bool>
+      insert_noresize(const value_type& __obj)
+      { return _M_ht.insert_unique_noresize(__obj); }
+
+      iterator
+      find(const key_type& __key)
+      { return _M_ht.find(__key); }
+
+      const_iterator
+      find(const key_type& __key) const
+      { return _M_ht.find(__key); }
+
+      _Tp&
+      operator[](const key_type& __key)
+      { return _M_ht.find_or_insert(value_type(__key, _Tp())).second; }
+
+      size_type
+      count(const key_type& __key) const
+      { return _M_ht.count(__key); }
+
+      pair<iterator, iterator>
+      equal_range(const key_type& __key)
+      { return _M_ht.equal_range(__key); }
+
+      pair<const_iterator, const_iterator>
+      equal_range(const key_type& __key) const
+      { return _M_ht.equal_range(__key); }
+
+      size_type
+      erase(const key_type& __key)
+      {return _M_ht.erase(__key); }
+
+      void
+      erase(iterator __it)
+      { _M_ht.erase(__it); }
+
+      void
+      erase(iterator __f, iterator __l)
+      { _M_ht.erase(__f, __l); }
+
+      void
+      clear()
+      { _M_ht.clear(); }
+
+      void
+      resize(size_type __hint)
+      { _M_ht.resize(__hint); }
+
+      size_type
+      bucket_count() const
+      { return _M_ht.bucket_count(); }
+
+      size_type
+      max_bucket_count() const
+      { return _M_ht.max_bucket_count(); }
+
+      size_type
+      elems_in_bucket(size_type __n) const
+      { return _M_ht.elems_in_bucket(__n); }
+    };
+
+  template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+    inline bool
+    operator==(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+	       const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+    { return __hm1._M_ht == __hm2._M_ht; }
+
+  template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+    inline bool
+    operator!=(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+	       const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+    { return !(__hm1 == __hm2); }
+
+  template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+    inline void
+    swap(hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+	 hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+    { __hm1.swap(__hm2); }
+
+
+  /**
+   *  This is an SGI extension.
+   *  @ingroup SGIextensions
+   *  @doctodo
+   */
+  template<class _Key, class _Tp,
+	   class _HashFn = hash<_Key>,
+	   class _EqualKey = equal_to<_Key>,
+	   class _Alloc = allocator<_Tp> >
+    class hash_multimap
+    {
+      // concept requirements
+      __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+      __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+      __glibcxx_class_requires3(_HashFn, size_t, _Key, _UnaryFunctionConcept)
+      __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept)
+	
+    private:
+      typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFn,
+			_Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+          _Ht;
+
+      _Ht _M_ht;
+
+    public:
+      typedef typename _Ht::key_type key_type;
+      typedef _Tp data_type;
+      typedef _Tp mapped_type;
+      typedef typename _Ht::value_type value_type;
+      typedef typename _Ht::hasher hasher;
+      typedef typename _Ht::key_equal key_equal;
+      
+      typedef typename _Ht::size_type size_type;
+      typedef typename _Ht::difference_type difference_type;
+      typedef typename _Ht::pointer pointer;
+      typedef typename _Ht::const_pointer const_pointer;
+      typedef typename _Ht::reference reference;
+      typedef typename _Ht::const_reference const_reference;
+      
+      typedef typename _Ht::iterator iterator;
+      typedef typename _Ht::const_iterator const_iterator;
+      
+      typedef typename _Ht::allocator_type allocator_type;
+      
+      hasher
+      hash_funct() const
+      { return _M_ht.hash_funct(); }
+
+      key_equal
+      key_eq() const
+      { return _M_ht.key_eq(); }
+
+      allocator_type
+      get_allocator() const
+      { return _M_ht.get_allocator(); }
+
+      hash_multimap()
+      : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+      explicit
+      hash_multimap(size_type __n)
+      : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+      hash_multimap(size_type __n, const hasher& __hf)
+      : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+      hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
+		    const allocator_type& __a = allocator_type())
+      : _M_ht(__n, __hf, __eql, __a) {}
+
+      template<class _InputIterator>
+        hash_multimap(_InputIterator __f, _InputIterator __l)
+	: _M_ht(100, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_equal(__f, __l); }
+
+      template<class _InputIterator>
+        hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
+	: _M_ht(__n, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_equal(__f, __l); }
+
+      template<class _InputIterator>
+        hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+		      const hasher& __hf)
+	: _M_ht(__n, __hf, key_equal(), allocator_type())
+        { _M_ht.insert_equal(__f, __l); }
+
+      template<class _InputIterator>
+        hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+		      const hasher& __hf, const key_equal& __eql,
+		      const allocator_type& __a = allocator_type())
+	: _M_ht(__n, __hf, __eql, __a)
+        { _M_ht.insert_equal(__f, __l); }
+
+      size_type
+      size() const
+      { return _M_ht.size(); }
+
+      size_type
+      max_size() const
+      { return _M_ht.max_size(); }
+
+      bool
+      empty() const
+      { return _M_ht.empty(); }
+
+      void
+      swap(hash_multimap& __hs)
+      { _M_ht.swap(__hs._M_ht); }
+
+      template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+        friend bool
+        operator==(const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
+		   const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
+
+      iterator
+      begin()
+      { return _M_ht.begin(); }
+
+      iterator
+      end()
+      { return _M_ht.end(); }
+
+      const_iterator
+      begin() const
+      { return _M_ht.begin(); }
+
+      const_iterator
+      end() const
+      { return _M_ht.end(); }
+
+      iterator
+      insert(const value_type& __obj)
+      { return _M_ht.insert_equal(__obj); }
+
+      template<class _InputIterator>
+        void
+        insert(_InputIterator __f, _InputIterator __l)
+        { _M_ht.insert_equal(__f,__l); }
+
+      iterator
+      insert_noresize(const value_type& __obj)
+      { return _M_ht.insert_equal_noresize(__obj); }
+
+      iterator
+      find(const key_type& __key)
+      { return _M_ht.find(__key); }
+
+      const_iterator
+      find(const key_type& __key) const
+      { return _M_ht.find(__key); }
+
+      size_type
+      count(const key_type& __key) const
+      { return _M_ht.count(__key); }
+
+      pair<iterator, iterator>
+      equal_range(const key_type& __key)
+      { return _M_ht.equal_range(__key); }
+
+      pair<const_iterator, const_iterator>
+      equal_range(const key_type& __key) const
+      { return _M_ht.equal_range(__key); }
+
+      size_type
+      erase(const key_type& __key)
+      { return _M_ht.erase(__key); }
+
+      void
+      erase(iterator __it)
+      { _M_ht.erase(__it); }
+
+      void
+      erase(iterator __f, iterator __l)
+      { _M_ht.erase(__f, __l); }
+
+      void
+      clear()
+      { _M_ht.clear(); }
+
+      void
+      resize(size_type __hint)
+      { _M_ht.resize(__hint); }
+
+      size_type
+      bucket_count() const
+      { return _M_ht.bucket_count(); }
+
+      size_type
+      max_bucket_count() const
+      { return _M_ht.max_bucket_count(); }
+      
+      size_type
+      elems_in_bucket(size_type __n) const
+      { return _M_ht.elems_in_bucket(__n); }
+    };
+
+  template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+    inline bool
+    operator==(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+	       const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+    { return __hm1._M_ht == __hm2._M_ht; }
+
+  template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+    inline bool
+    operator!=(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+	       const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+    { return !(__hm1 == __hm2); }
+
+  template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+    inline void
+    swap(hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+	 hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+    { __hm1.swap(__hm2); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Specialization of insert_iterator so that it will work for hash_map
+  // and hash_multimap.
+  template<class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
+    class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn, 
+					      _EqKey, _Alloc> >
+    {
+    protected:
+      typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+        _Container;
+      _Container* container;
+
+    public:
+      typedef _Container          container_type;
+      typedef output_iterator_tag iterator_category;
+      typedef void                value_type;
+      typedef void                difference_type;
+      typedef void                pointer;
+      typedef void                reference;
+      
+      insert_iterator(_Container& __x)
+      : container(&__x) {}
+
+      insert_iterator(_Container& __x, typename _Container::iterator)
+      : container(&__x) {}
+
+      insert_iterator<_Container>&
+      operator=(const typename _Container::value_type& __value)
+      {
+	container->insert(__value);
+	return *this;
+      }
+
+      insert_iterator<_Container>&
+      operator*()
+      { return *this; }
+
+      insert_iterator<_Container>&
+      operator++() { return *this; }
+
+      insert_iterator<_Container>&
+      operator++(int)
+      { return *this; }
+    };
+
+  template<class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
+    class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn,
+						   _EqKey, _Alloc> >
+    {
+    protected:
+      typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+        _Container;
+      _Container* container;
+      typename _Container::iterator iter;
+
+    public:
+      typedef _Container          container_type;
+      typedef output_iterator_tag iterator_category;
+      typedef void                value_type;
+      typedef void                difference_type;
+      typedef void                pointer;
+      typedef void                reference;
+
+      insert_iterator(_Container& __x)
+      : container(&__x) {}
+
+      insert_iterator(_Container& __x, typename _Container::iterator)
+      : container(&__x) {}
+
+      insert_iterator<_Container>&
+      operator=(const typename _Container::value_type& __value)
+      {
+	container->insert(__value);
+	return *this;
+      }
+
+      insert_iterator<_Container>&
+      operator*()
+      { return *this; }
+
+      insert_iterator<_Container>&
+      operator++()
+      { return *this; }
+
+      insert_iterator<_Container>&
+      operator++(int)
+      { return *this; }
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 567 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hash_set

@@ -0,0 +1,567 @@
+// Hashing set implementation -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_set
+ *  This file is a GNU extension to the Standard C++ Library (possibly
+ *  containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _BACKWARD_HASH_SET
+#define _BACKWARD_HASH_SET 1
+
+#ifndef _GLIBCXX_PERMIT_BACKWARD_HASH
+#include "backward_warning.h"
+#endif
+
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  using std::equal_to;
+  using std::allocator;
+  using std::pair;
+  using std::_Identity;
+
+  /**
+   *  This is an SGI extension.
+   *  @ingroup SGIextensions
+   *  @doctodo
+   */
+  template<class _Value, class _HashFcn  = hash<_Value>,
+	   class _EqualKey = equal_to<_Value>,
+	   class _Alloc = allocator<_Value> >
+    class hash_set
+    {
+      // concept requirements
+      __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+      __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+      __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+    private:
+      typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+			_EqualKey, _Alloc> _Ht;
+      _Ht _M_ht;
+
+    public:
+      typedef typename _Ht::key_type key_type;
+      typedef typename _Ht::value_type value_type;
+      typedef typename _Ht::hasher hasher;
+      typedef typename _Ht::key_equal key_equal;
+      
+      typedef typename _Ht::size_type size_type;
+      typedef typename _Ht::difference_type difference_type;
+      typedef typename _Alloc::pointer pointer;
+      typedef typename _Alloc::const_pointer const_pointer;
+      typedef typename _Alloc::reference reference;
+      typedef typename _Alloc::const_reference const_reference;
+      
+      typedef typename _Ht::const_iterator iterator;
+      typedef typename _Ht::const_iterator const_iterator;
+      
+      typedef typename _Ht::allocator_type allocator_type;
+      
+      hasher
+      hash_funct() const
+      { return _M_ht.hash_funct(); }
+
+      key_equal
+      key_eq() const
+      { return _M_ht.key_eq(); }
+
+      allocator_type
+      get_allocator() const
+      { return _M_ht.get_allocator(); }
+
+      hash_set()
+      : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+      explicit
+      hash_set(size_type __n)
+      : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+      hash_set(size_type __n, const hasher& __hf)
+      : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+      hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+	       const allocator_type& __a = allocator_type())
+      : _M_ht(__n, __hf, __eql, __a) {}
+
+      template<class _InputIterator>
+        hash_set(_InputIterator __f, _InputIterator __l)
+	: _M_ht(100, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_unique(__f, __l); }
+
+      template<class _InputIterator>
+        hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
+	: _M_ht(__n, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_unique(__f, __l); }
+
+      template<class _InputIterator>
+        hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+		 const hasher& __hf)
+	: _M_ht(__n, __hf, key_equal(), allocator_type())
+        { _M_ht.insert_unique(__f, __l); }
+
+      template<class _InputIterator>
+        hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+		 const hasher& __hf, const key_equal& __eql,
+		 const allocator_type& __a = allocator_type())
+	: _M_ht(__n, __hf, __eql, __a)
+        { _M_ht.insert_unique(__f, __l); }
+
+      size_type
+      size() const
+      { return _M_ht.size(); }
+
+      size_type
+      max_size() const
+      { return _M_ht.max_size(); }
+      
+      bool
+      empty() const
+      { return _M_ht.empty(); }
+      
+      void
+      swap(hash_set& __hs)
+      { _M_ht.swap(__hs._M_ht); }
+
+      template<class _Val, class _HF, class _EqK, class _Al>
+        friend bool
+        operator==(const hash_set<_Val, _HF, _EqK, _Al>&,
+		   const hash_set<_Val, _HF, _EqK, _Al>&);
+
+      iterator
+      begin() const
+      { return _M_ht.begin(); }
+      
+      iterator
+      end() const
+      { return _M_ht.end(); }
+
+      pair<iterator, bool>
+      insert(const value_type& __obj)
+      {
+	pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
+	return pair<iterator,bool>(__p.first, __p.second);
+      }
+
+      template<class _InputIterator>
+        void
+        insert(_InputIterator __f, _InputIterator __l)
+        { _M_ht.insert_unique(__f, __l); }
+
+      pair<iterator, bool>
+      insert_noresize(const value_type& __obj)
+      {
+	pair<typename _Ht::iterator, bool> __p
+	  = _M_ht.insert_unique_noresize(__obj);
+	return pair<iterator, bool>(__p.first, __p.second);
+      }
+
+      iterator
+      find(const key_type& __key) const
+      { return _M_ht.find(__key); }
+
+      size_type
+      count(const key_type& __key) const
+      { return _M_ht.count(__key); }
+
+      pair<iterator, iterator>
+      equal_range(const key_type& __key) const
+      { return _M_ht.equal_range(__key); }
+
+      size_type
+      erase(const key_type& __key)
+      {return _M_ht.erase(__key); }
+      
+      void
+      erase(iterator __it)
+      { _M_ht.erase(__it); }
+      
+      void
+      erase(iterator __f, iterator __l)
+      { _M_ht.erase(__f, __l); }
+      
+      void
+      clear()
+      { _M_ht.clear(); }
+
+      void
+      resize(size_type __hint)
+      { _M_ht.resize(__hint); }
+      
+      size_type
+      bucket_count() const
+      { return _M_ht.bucket_count(); }
+      
+      size_type
+      max_bucket_count() const
+      { return _M_ht.max_bucket_count(); }
+      
+      size_type
+      elems_in_bucket(size_type __n) const
+      { return _M_ht.elems_in_bucket(__n); }
+    };
+
+  template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+    inline bool
+    operator==(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+	       const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+    { return __hs1._M_ht == __hs2._M_ht; }
+
+  template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+    inline bool
+    operator!=(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+	       const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+    { return !(__hs1 == __hs2); }
+
+  template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+    inline void
+    swap(hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+	 hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+    { __hs1.swap(__hs2); }
+
+
+  /**
+   *  This is an SGI extension.
+   *  @ingroup SGIextensions
+   *  @doctodo
+   */
+  template<class _Value,
+	   class _HashFcn = hash<_Value>,
+	   class _EqualKey = equal_to<_Value>,
+	   class _Alloc = allocator<_Value> >
+    class hash_multiset
+    {
+      // concept requirements
+      __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+      __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+      __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+    private:
+      typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+			_EqualKey, _Alloc> _Ht;
+      _Ht _M_ht;
+
+    public:
+      typedef typename _Ht::key_type key_type;
+      typedef typename _Ht::value_type value_type;
+      typedef typename _Ht::hasher hasher;
+      typedef typename _Ht::key_equal key_equal;
+      
+      typedef typename _Ht::size_type size_type;
+      typedef typename _Ht::difference_type difference_type;
+      typedef typename _Alloc::pointer pointer;
+      typedef typename _Alloc::const_pointer const_pointer;
+      typedef typename _Alloc::reference reference;
+      typedef typename _Alloc::const_reference const_reference;
+
+      typedef typename _Ht::const_iterator iterator;
+      typedef typename _Ht::const_iterator const_iterator;
+      
+      typedef typename _Ht::allocator_type allocator_type;
+      
+      hasher
+      hash_funct() const
+      { return _M_ht.hash_funct(); }
+      
+      key_equal
+      key_eq() const
+      { return _M_ht.key_eq(); }
+      
+      allocator_type
+      get_allocator() const
+      { return _M_ht.get_allocator(); }
+
+      hash_multiset()
+      : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+      explicit
+      hash_multiset(size_type __n)
+      : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+      hash_multiset(size_type __n, const hasher& __hf)
+      : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+      
+      hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
+		    const allocator_type& __a = allocator_type())
+      : _M_ht(__n, __hf, __eql, __a) {}
+
+      template<class _InputIterator>
+        hash_multiset(_InputIterator __f, _InputIterator __l)
+	: _M_ht(100, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_equal(__f, __l); }
+
+      template<class _InputIterator>
+        hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
+	: _M_ht(__n, hasher(), key_equal(), allocator_type())
+        { _M_ht.insert_equal(__f, __l); }
+
+      template<class _InputIterator>
+        hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+		      const hasher& __hf)
+	: _M_ht(__n, __hf, key_equal(), allocator_type())
+        { _M_ht.insert_equal(__f, __l); }
+
+      template<class _InputIterator>
+        hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+		      const hasher& __hf, const key_equal& __eql,
+		      const allocator_type& __a = allocator_type())
+	: _M_ht(__n, __hf, __eql, __a)
+        { _M_ht.insert_equal(__f, __l); }
+
+      size_type
+      size() const
+      { return _M_ht.size(); }
+
+      size_type
+      max_size() const
+      { return _M_ht.max_size(); }
+
+      bool
+      empty() const
+      { return _M_ht.empty(); }
+
+      void
+      swap(hash_multiset& hs)
+      { _M_ht.swap(hs._M_ht); }
+
+      template<class _Val, class _HF, class _EqK, class _Al>
+        friend bool
+        operator==(const hash_multiset<_Val, _HF, _EqK, _Al>&,
+		   const hash_multiset<_Val, _HF, _EqK, _Al>&);
+
+      iterator
+      begin() const
+      { return _M_ht.begin(); }
+      
+      iterator
+      end() const
+      { return _M_ht.end(); }
+
+      iterator
+      insert(const value_type& __obj)
+      { return _M_ht.insert_equal(__obj); }
+  
+      template<class _InputIterator>
+        void
+        insert(_InputIterator __f, _InputIterator __l)
+        { _M_ht.insert_equal(__f,__l); }
+  
+      iterator
+      insert_noresize(const value_type& __obj)
+      { return _M_ht.insert_equal_noresize(__obj); }
+
+      iterator
+      find(const key_type& __key) const
+      { return _M_ht.find(__key); }
+
+      size_type
+      count(const key_type& __key) const
+      { return _M_ht.count(__key); }
+
+      pair<iterator, iterator>
+      equal_range(const key_type& __key) const
+      { return _M_ht.equal_range(__key); }
+
+      size_type
+      erase(const key_type& __key)
+      { return _M_ht.erase(__key); }
+  
+      void
+      erase(iterator __it)
+      { _M_ht.erase(__it); }
+  
+      void
+      erase(iterator __f, iterator __l)
+      { _M_ht.erase(__f, __l); }
+  
+      void
+      clear()
+      { _M_ht.clear(); }
+
+      void
+      resize(size_type __hint)
+      { _M_ht.resize(__hint); }
+  
+      size_type
+      bucket_count() const
+      { return _M_ht.bucket_count(); }
+
+      size_type
+      max_bucket_count() const
+      { return _M_ht.max_bucket_count(); }
+
+      size_type
+      elems_in_bucket(size_type __n) const
+      { return _M_ht.elems_in_bucket(__n); }
+    };
+
+  template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+    inline bool
+    operator==(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+	       const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+    { return __hs1._M_ht == __hs2._M_ht; }
+
+  template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+    inline bool
+    operator!=(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+	       const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+    { return !(__hs1 == __hs2); }
+
+  template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+    inline void
+    swap(hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+	 hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+    { __hs1.swap(__hs2); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Specialization of insert_iterator so that it will work for hash_set
+  // and hash_multiset.
+  template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+    class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn,
+					      _EqualKey, _Alloc> >
+    {
+    protected:
+      typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>
+        _Container;
+      _Container* container;
+
+    public:
+      typedef _Container          container_type;
+      typedef output_iterator_tag iterator_category;
+      typedef void                value_type;
+      typedef void                difference_type;
+      typedef void                pointer;
+      typedef void                reference;
+
+      insert_iterator(_Container& __x)
+      : container(&__x) {}
+      
+      insert_iterator(_Container& __x, typename _Container::iterator)
+      : container(&__x) {}
+
+      insert_iterator<_Container>&
+      operator=(const typename _Container::value_type& __value)
+      {
+	container->insert(__value);
+	return *this;
+      }
+
+      insert_iterator<_Container>&
+      operator*()
+      { return *this; }
+      
+      insert_iterator<_Container>&
+      operator++()
+      { return *this; }
+      
+      insert_iterator<_Container>&
+      operator++(int)
+      { return *this; }
+    };
+
+  template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+    class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn,
+						   _EqualKey, _Alloc> >
+    {
+    protected:
+      typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>
+        _Container;
+      _Container* container;
+      typename _Container::iterator iter;
+
+    public:
+      typedef _Container          container_type;
+      typedef output_iterator_tag iterator_category;
+      typedef void                value_type;
+      typedef void                difference_type;
+      typedef void                pointer;
+      typedef void                reference;
+      
+      insert_iterator(_Container& __x)
+      : container(&__x) {}
+      
+      insert_iterator(_Container& __x, typename _Container::iterator)
+      : container(&__x) {}
+
+      insert_iterator<_Container>&
+      operator=(const typename _Container::value_type& __value)
+      {
+	container->insert(__value);
+	return *this;
+      }
+
+      insert_iterator<_Container>&
+      operator*()
+      { return *this; }
+
+      insert_iterator<_Container>&
+      operator++()
+      { return *this; }
+
+      insert_iterator<_Container>&
+      operator++(int) { return *this; }
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 1167 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/hashtable.h

@@ -0,0 +1,1167 @@
+// Hashtable implementation used by containers -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hashtable.h
+ *  This file is a GNU extension to the Standard C++ Library (possibly
+ *  containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _BACKWARD_HASHTABLE_H
+#define _BACKWARD_HASHTABLE_H 1
+
+// Hashtable class, used to implement the hashed associative containers
+// hash_set, hash_map, hash_multiset, and hash_multimap.
+
+#include <vector>
+#include <iterator>
+#include <algorithm>
+#include <bits/stl_function.h>
+#include <backward/hash_fun.h>
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  using std::size_t;
+  using std::ptrdiff_t;
+  using std::forward_iterator_tag;
+  using std::input_iterator_tag;
+  using std::_Construct;
+  using std::_Destroy;
+  using std::distance;
+  using std::vector;
+  using std::pair;
+  using std::__iterator_category;
+
+  template<class _Val>
+    struct _Hashtable_node
+    {
+      _Hashtable_node* _M_next;
+      _Val _M_val;
+    };
+
+  template<class _Val, class _Key, class _HashFcn, class _ExtractKey, 
+	   class _EqualKey, class _Alloc = std::allocator<_Val> >
+    class hashtable;
+
+  template<class _Val, class _Key, class _HashFcn,
+	   class _ExtractKey, class _EqualKey, class _Alloc>
+    struct _Hashtable_iterator;
+
+  template<class _Val, class _Key, class _HashFcn,
+	   class _ExtractKey, class _EqualKey, class _Alloc>
+    struct _Hashtable_const_iterator;
+
+  template<class _Val, class _Key, class _HashFcn,
+	   class _ExtractKey, class _EqualKey, class _Alloc>
+    struct _Hashtable_iterator
+    {
+      typedef hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>
+        _Hashtable;
+      typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
+				  _ExtractKey, _EqualKey, _Alloc>
+        iterator;
+      typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+					_ExtractKey, _EqualKey, _Alloc>
+        const_iterator;
+      typedef _Hashtable_node<_Val> _Node;
+      typedef forward_iterator_tag iterator_category;
+      typedef _Val value_type;
+      typedef ptrdiff_t difference_type;
+      typedef size_t size_type;
+      typedef _Val& reference;
+      typedef _Val* pointer;
+      
+      _Node* _M_cur;
+      _Hashtable* _M_ht;
+
+      _Hashtable_iterator(_Node* __n, _Hashtable* __tab)
+      : _M_cur(__n), _M_ht(__tab) { }
+
+      _Hashtable_iterator() { }
+
+      reference
+      operator*() const
+      { return _M_cur->_M_val; }
+
+      pointer
+      operator->() const
+      { return &(operator*()); }
+
+      iterator&
+      operator++();
+
+      iterator
+      operator++(int);
+
+      bool
+      operator==(const iterator& __it) const
+      { return _M_cur == __it._M_cur; }
+
+      bool
+      operator!=(const iterator& __it) const
+      { return _M_cur != __it._M_cur; }
+    };
+
+  template<class _Val, class _Key, class _HashFcn,
+	   class _ExtractKey, class _EqualKey, class _Alloc>
+    struct _Hashtable_const_iterator
+    {
+      typedef hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>
+        _Hashtable;
+      typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
+				  _ExtractKey,_EqualKey,_Alloc>
+        iterator;
+      typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+					_ExtractKey, _EqualKey, _Alloc>
+        const_iterator;
+      typedef _Hashtable_node<_Val> _Node;
+
+      typedef forward_iterator_tag iterator_category;
+      typedef _Val value_type;
+      typedef ptrdiff_t difference_type;
+      typedef size_t size_type;
+      typedef const _Val& reference;
+      typedef const _Val* pointer;
+      
+      const _Node* _M_cur;
+      const _Hashtable* _M_ht;
+
+      _Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab)
+      : _M_cur(__n), _M_ht(__tab) { }
+
+      _Hashtable_const_iterator() { }
+
+      _Hashtable_const_iterator(const iterator& __it)
+      : _M_cur(__it._M_cur), _M_ht(__it._M_ht) { }
+
+      reference
+      operator*() const
+      { return _M_cur->_M_val; }
+
+      pointer
+      operator->() const
+      { return &(operator*()); }
+
+      const_iterator&
+      operator++();
+
+      const_iterator
+      operator++(int);
+
+      bool
+      operator==(const const_iterator& __it) const
+      { return _M_cur == __it._M_cur; }
+
+      bool
+      operator!=(const const_iterator& __it) const
+      { return _M_cur != __it._M_cur; }
+    };
+
+  // Note: assumes long is at least 32 bits.
+  enum { _S_num_primes = 29 };
+
+  template<typename _PrimeType>
+    struct _Hashtable_prime_list
+    {
+      static const _PrimeType  __stl_prime_list[_S_num_primes];
+
+      static const _PrimeType*
+      _S_get_prime_list();
+    };
+
+  template<typename _PrimeType> const _PrimeType
+  _Hashtable_prime_list<_PrimeType>::__stl_prime_list[_S_num_primes] =
+    {
+      5ul,          53ul,         97ul,         193ul,       389ul,
+      769ul,        1543ul,       3079ul,       6151ul,      12289ul,
+      24593ul,      49157ul,      98317ul,      196613ul,    393241ul,
+      786433ul,     1572869ul,    3145739ul,    6291469ul,   12582917ul,
+      25165843ul,   50331653ul,   100663319ul,  201326611ul, 402653189ul,
+      805306457ul,  1610612741ul, 3221225473ul, 4294967291ul
+    };
+
+ template<class _PrimeType> inline const _PrimeType*
+ _Hashtable_prime_list<_PrimeType>::_S_get_prime_list()
+ {
+   return __stl_prime_list;
+ }
+
+  inline unsigned long
+  __stl_next_prime(unsigned long __n)
+  {
+    const unsigned long* __first = _Hashtable_prime_list<unsigned long>::_S_get_prime_list();
+    const unsigned long* __last = __first + (int)_S_num_primes;
+    const unsigned long* pos = std::lower_bound(__first, __last, __n);
+    return pos == __last ? *(__last - 1) : *pos;
+  }
+
+  // Forward declaration of operator==.  
+  template<class _Val, class _Key, class _HF, class _Ex,
+	   class _Eq, class _All>
+    class hashtable;
+
+  template<class _Val, class _Key, class _HF, class _Ex,
+	   class _Eq, class _All>
+    bool
+    operator==(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+	       const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2);
+
+  // Hashtables handle allocators a bit differently than other
+  // containers do.  If we're using standard-conforming allocators, then
+  // a hashtable unconditionally has a member variable to hold its
+  // allocator, even if it so happens that all instances of the
+  // allocator type are identical.  This is because, for hashtables,
+  // this extra storage is negligible.  Additionally, a base class
+  // wouldn't serve any other purposes; it wouldn't, for example,
+  // simplify the exception-handling code.  
+  template<class _Val, class _Key, class _HashFcn,
+	   class _ExtractKey, class _EqualKey, class _Alloc>
+    class hashtable
+    {
+    public:
+      typedef _Key key_type;
+      typedef _Val value_type;
+      typedef _HashFcn hasher;
+      typedef _EqualKey key_equal;
+
+      typedef size_t            size_type;
+      typedef ptrdiff_t         difference_type;
+      typedef value_type*       pointer;
+      typedef const value_type* const_pointer;
+      typedef value_type&       reference;
+      typedef const value_type& const_reference;
+
+      hasher
+      hash_funct() const
+      { return _M_hash; }
+
+      key_equal
+      key_eq() const
+      { return _M_equals; }
+
+    private:
+      typedef _Hashtable_node<_Val> _Node;
+
+    public:
+      typedef typename _Alloc::template rebind<value_type>::other allocator_type;
+      allocator_type
+      get_allocator() const
+      { return _M_node_allocator; }
+
+    private:
+      typedef typename _Alloc::template rebind<_Node>::other _Node_Alloc;
+      typedef typename _Alloc::template rebind<_Node*>::other _Nodeptr_Alloc;
+      typedef vector<_Node*, _Nodeptr_Alloc> _Vector_type;
+
+      _Node_Alloc _M_node_allocator;
+
+      _Node*
+      _M_get_node()
+      { return _M_node_allocator.allocate(1); }
+
+      void
+      _M_put_node(_Node* __p)
+      { _M_node_allocator.deallocate(__p, 1); }
+
+    private:
+      hasher                _M_hash;
+      key_equal             _M_equals;
+      _ExtractKey           _M_get_key;
+      _Vector_type          _M_buckets;
+      size_type             _M_num_elements;
+      
+    public:
+      typedef _Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+				  _EqualKey, _Alloc>
+        iterator;
+      typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+					_EqualKey, _Alloc>
+        const_iterator;
+
+      friend struct
+      _Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>;
+
+      friend struct
+      _Hashtable_const_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+				_EqualKey, _Alloc>;
+
+    public:
+      hashtable(size_type __n, const _HashFcn& __hf,
+		const _EqualKey& __eql, const _ExtractKey& __ext,
+		const allocator_type& __a = allocator_type())
+      : _M_node_allocator(__a), _M_hash(__hf), _M_equals(__eql),
+	_M_get_key(__ext), _M_buckets(__a), _M_num_elements(0)
+      { _M_initialize_buckets(__n); }
+
+      hashtable(size_type __n, const _HashFcn& __hf,
+		const _EqualKey& __eql,
+		const allocator_type& __a = allocator_type())
+      : _M_node_allocator(__a), _M_hash(__hf), _M_equals(__eql),
+	_M_get_key(_ExtractKey()), _M_buckets(__a), _M_num_elements(0)
+      { _M_initialize_buckets(__n); }
+
+      hashtable(const hashtable& __ht)
+      : _M_node_allocator(__ht.get_allocator()), _M_hash(__ht._M_hash),
+      _M_equals(__ht._M_equals), _M_get_key(__ht._M_get_key),
+      _M_buckets(__ht.get_allocator()), _M_num_elements(0)
+      { _M_copy_from(__ht); }
+
+      hashtable&
+      operator= (const hashtable& __ht)
+      {
+	if (&__ht != this)
+	  {
+	    clear();
+	    _M_hash = __ht._M_hash;
+	    _M_equals = __ht._M_equals;
+	    _M_get_key = __ht._M_get_key;
+	    _M_copy_from(__ht);
+	  }
+	return *this;
+      }
+
+      ~hashtable()
+      { clear(); }
+
+      size_type
+      size() const
+      { return _M_num_elements; }
+
+      size_type
+      max_size() const
+      { return size_type(-1); }
+
+      bool
+      empty() const
+      { return size() == 0; }
+
+      void
+      swap(hashtable& __ht)
+      {
+	std::swap(_M_hash, __ht._M_hash);
+	std::swap(_M_equals, __ht._M_equals);
+	std::swap(_M_get_key, __ht._M_get_key);
+	_M_buckets.swap(__ht._M_buckets);
+	std::swap(_M_num_elements, __ht._M_num_elements);
+      }
+
+      iterator
+      begin()
+      {
+	for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
+	  if (_M_buckets[__n])
+	    return iterator(_M_buckets[__n], this);
+	return end();
+      }
+
+      iterator
+      end()
+      { return iterator(0, this); }
+
+      const_iterator
+      begin() const
+      {
+	for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
+	  if (_M_buckets[__n])
+	    return const_iterator(_M_buckets[__n], this);
+	return end();
+      }
+
+      const_iterator
+      end() const
+      { return const_iterator(0, this); }
+
+      template<class _Vl, class _Ky, class _HF, class _Ex, class _Eq,
+		class _Al>
+        friend bool
+        operator==(const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&,
+		   const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&);
+
+    public:
+      size_type
+      bucket_count() const
+      { return _M_buckets.size(); }
+
+      size_type
+      max_bucket_count() const
+      { return _Hashtable_prime_list<unsigned long>::
+               _S_get_prime_list()[(int)_S_num_primes - 1];
+      }
+
+      size_type
+      elems_in_bucket(size_type __bucket) const
+      {
+	size_type __result = 0;
+	for (_Node* __n = _M_buckets[__bucket]; __n; __n = __n->_M_next)
+	  __result += 1;
+	return __result;
+      }
+
+      pair<iterator, bool>
+      insert_unique(const value_type& __obj)
+      {
+	resize(_M_num_elements + 1);
+	return insert_unique_noresize(__obj);
+      }
+
+      iterator
+      insert_equal(const value_type& __obj)
+      {
+	resize(_M_num_elements + 1);
+	return insert_equal_noresize(__obj);
+      }
+
+      pair<iterator, bool>
+      insert_unique_noresize(const value_type& __obj);
+
+      iterator
+      insert_equal_noresize(const value_type& __obj);
+
+      template<class _InputIterator>
+        void
+        insert_unique(_InputIterator __f, _InputIterator __l)
+        { insert_unique(__f, __l, __iterator_category(__f)); }
+
+      template<class _InputIterator>
+        void
+        insert_equal(_InputIterator __f, _InputIterator __l)
+        { insert_equal(__f, __l, __iterator_category(__f)); }
+
+      template<class _InputIterator>
+        void
+        insert_unique(_InputIterator __f, _InputIterator __l,
+		      input_iterator_tag)
+        {
+	  for ( ; __f != __l; ++__f)
+	    insert_unique(*__f);
+	}
+
+      template<class _InputIterator>
+        void
+        insert_equal(_InputIterator __f, _InputIterator __l,
+		     input_iterator_tag)
+        {
+	  for ( ; __f != __l; ++__f)
+	    insert_equal(*__f);
+	}
+
+      template<class _ForwardIterator>
+        void
+        insert_unique(_ForwardIterator __f, _ForwardIterator __l,
+		      forward_iterator_tag)
+        {
+	  size_type __n = distance(__f, __l);
+	  resize(_M_num_elements + __n);
+	  for ( ; __n > 0; --__n, ++__f)
+	    insert_unique_noresize(*__f);
+	}
+
+      template<class _ForwardIterator>
+        void
+        insert_equal(_ForwardIterator __f, _ForwardIterator __l,
+		     forward_iterator_tag)
+        {
+	  size_type __n = distance(__f, __l);
+	  resize(_M_num_elements + __n);
+	  for ( ; __n > 0; --__n, ++__f)
+	    insert_equal_noresize(*__f);
+	}
+
+      reference
+      find_or_insert(const value_type& __obj);
+
+      iterator
+      find(const key_type& __key)
+      {
+	size_type __n = _M_bkt_num_key(__key);
+	_Node* __first;
+	for (__first = _M_buckets[__n];
+	     __first && !_M_equals(_M_get_key(__first->_M_val), __key);
+	     __first = __first->_M_next)
+	  { }
+	return iterator(__first, this);
+      }
+
+      const_iterator
+      find(const key_type& __key) const
+      {
+	size_type __n = _M_bkt_num_key(__key);
+	const _Node* __first;
+	for (__first = _M_buckets[__n];
+	     __first && !_M_equals(_M_get_key(__first->_M_val), __key);
+	     __first = __first->_M_next)
+	  { }
+	return const_iterator(__first, this);
+      }
+
+      size_type
+      count(const key_type& __key) const
+      {
+	const size_type __n = _M_bkt_num_key(__key);
+	size_type __result = 0;
+	
+	for (const _Node* __cur = _M_buckets[__n]; __cur;
+	     __cur = __cur->_M_next)
+	  if (_M_equals(_M_get_key(__cur->_M_val), __key))
+	    ++__result;
+	return __result;
+      }
+
+      pair<iterator, iterator>
+      equal_range(const key_type& __key);
+
+      pair<const_iterator, const_iterator>
+      equal_range(const key_type& __key) const;
+
+      size_type
+      erase(const key_type& __key);
+      
+      void
+      erase(const iterator& __it);
+
+      void
+      erase(iterator __first, iterator __last);
+
+      void
+      erase(const const_iterator& __it);
+
+      void
+      erase(const_iterator __first, const_iterator __last);
+
+      void
+      resize(size_type __num_elements_hint);
+
+      void
+      clear();
+
+    private:
+      size_type
+      _M_next_size(size_type __n) const
+      { return __stl_next_prime(__n); }
+
+      void
+      _M_initialize_buckets(size_type __n)
+      {
+	const size_type __n_buckets = _M_next_size(__n);
+	_M_buckets.reserve(__n_buckets);
+	_M_buckets.insert(_M_buckets.end(), __n_buckets, (_Node*) 0);
+	_M_num_elements = 0;
+      }
+
+      size_type
+      _M_bkt_num_key(const key_type& __key) const
+      { return _M_bkt_num_key(__key, _M_buckets.size()); }
+
+      size_type
+      _M_bkt_num(const value_type& __obj) const
+      { return _M_bkt_num_key(_M_get_key(__obj)); }
+
+      size_type
+      _M_bkt_num_key(const key_type& __key, size_t __n) const
+      { return _M_hash(__key) % __n; }
+
+      size_type
+      _M_bkt_num(const value_type& __obj, size_t __n) const
+      { return _M_bkt_num_key(_M_get_key(__obj), __n); }
+
+      _Node*
+      _M_new_node(const value_type& __obj)
+      {
+	_Node* __n = _M_get_node();
+	__n->_M_next = 0;
+	__try
+	  {
+	    this->get_allocator().construct(&__n->_M_val, __obj);
+	    return __n;
+	  }
+	__catch(...)
+	  {
+	    _M_put_node(__n);
+	    __throw_exception_again;
+	  }
+      }
+
+      void
+      _M_delete_node(_Node* __n)
+      {
+	this->get_allocator().destroy(&__n->_M_val);
+	_M_put_node(__n);
+      }
+      
+      void
+      _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last);
+
+      void
+      _M_erase_bucket(const size_type __n, _Node* __last);
+
+      void
+      _M_copy_from(const hashtable& __ht);
+    };
+
+  template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+	    class _All>
+    _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>&
+    _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+    operator++()
+    {
+      const _Node* __old = _M_cur;
+      _M_cur = _M_cur->_M_next;
+      if (!_M_cur)
+	{
+	  size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
+	  while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
+	    _M_cur = _M_ht->_M_buckets[__bucket];
+	}
+      return *this;
+    }
+
+  template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+	    class _All>
+    inline _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>
+    _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+    operator++(int)
+    {
+      iterator __tmp = *this;
+      ++*this;
+      return __tmp;
+    }
+
+  template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+	    class _All>
+    _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>&
+    _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+    operator++()
+    {
+      const _Node* __old = _M_cur;
+      _M_cur = _M_cur->_M_next;
+      if (!_M_cur)
+	{
+	  size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
+	  while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
+	    _M_cur = _M_ht->_M_buckets[__bucket];
+	}
+      return *this;
+    }
+
+  template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+	    class _All>
+    inline _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>
+    _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+    operator++(int)
+    {
+      const_iterator __tmp = *this;
+      ++*this;
+      return __tmp;
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    bool
+    operator==(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+	       const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2)
+    {
+      typedef typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::_Node _Node;
+
+      if (__ht1._M_buckets.size() != __ht2._M_buckets.size())
+	return false;
+
+      for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n)
+	{
+	  _Node* __cur1 = __ht1._M_buckets[__n];
+	  _Node* __cur2 = __ht2._M_buckets[__n];
+	  // Check same length of lists
+	  for (; __cur1 && __cur2;
+	       __cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
+	    { } 
+	  if (__cur1 || __cur2)
+	    return false;
+	  // Now check one's elements are in the other
+	  for (__cur1 = __ht1._M_buckets[__n] ; __cur1;
+	       __cur1 = __cur1->_M_next)
+	    {
+	      bool _found__cur1 = false;
+	      for (__cur2 = __ht2._M_buckets[__n];
+		   __cur2; __cur2 = __cur2->_M_next)
+		{
+		  if (__cur1->_M_val == __cur2->_M_val)
+		    {
+		      _found__cur1 = true;
+		      break;
+		    }
+		}
+	      if (!_found__cur1)
+		return false;
+	    }
+	}
+      return true;
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    inline bool
+    operator!=(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+	       const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2)
+    { return !(__ht1 == __ht2); }
+
+  template<class _Val, class _Key, class _HF, class _Extract, class _EqKey,
+	    class _All>
+    inline void
+    swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
+	 hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2)
+    { __ht1.swap(__ht2); }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator, bool>
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    insert_unique_noresize(const value_type& __obj)
+    {
+      const size_type __n = _M_bkt_num(__obj);
+      _Node* __first = _M_buckets[__n];
+      
+      for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+	if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+	  return pair<iterator, bool>(iterator(__cur, this), false);
+      
+      _Node* __tmp = _M_new_node(__obj);
+      __tmp->_M_next = __first;
+      _M_buckets[__n] = __tmp;
+      ++_M_num_elements;
+      return pair<iterator, bool>(iterator(__tmp, this), true);
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    insert_equal_noresize(const value_type& __obj)
+    {
+      const size_type __n = _M_bkt_num(__obj);
+      _Node* __first = _M_buckets[__n];
+      
+      for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+	if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+	  {
+	    _Node* __tmp = _M_new_node(__obj);
+	    __tmp->_M_next = __cur->_M_next;
+	    __cur->_M_next = __tmp;
+	    ++_M_num_elements;
+	    return iterator(__tmp, this);
+	  }
+
+      _Node* __tmp = _M_new_node(__obj);
+      __tmp->_M_next = __first;
+      _M_buckets[__n] = __tmp;
+      ++_M_num_elements;
+      return iterator(__tmp, this);
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::reference
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    find_or_insert(const value_type& __obj)
+    {
+      resize(_M_num_elements + 1);
+
+      size_type __n = _M_bkt_num(__obj);
+      _Node* __first = _M_buckets[__n];
+      
+      for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+	if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+	  return __cur->_M_val;
+      
+      _Node* __tmp = _M_new_node(__obj);
+      __tmp->_M_next = __first;
+      _M_buckets[__n] = __tmp;
+      ++_M_num_elements;
+      return __tmp->_M_val;
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator,
+	 typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator>
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    equal_range(const key_type& __key)
+    {
+      typedef pair<iterator, iterator> _Pii;
+      const size_type __n = _M_bkt_num_key(__key);
+
+      for (_Node* __first = _M_buckets[__n]; __first;
+	   __first = __first->_M_next)
+	if (_M_equals(_M_get_key(__first->_M_val), __key))
+	  {
+	    for (_Node* __cur = __first->_M_next; __cur;
+		 __cur = __cur->_M_next)
+	      if (!_M_equals(_M_get_key(__cur->_M_val), __key))
+		return _Pii(iterator(__first, this), iterator(__cur, this));
+	    for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
+	      if (_M_buckets[__m])
+		return _Pii(iterator(__first, this),
+			    iterator(_M_buckets[__m], this));
+	    return _Pii(iterator(__first, this), end());
+	  }
+      return _Pii(end(), end());
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::const_iterator,
+	 typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::const_iterator>
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    equal_range(const key_type& __key) const
+    {
+      typedef pair<const_iterator, const_iterator> _Pii;
+      const size_type __n = _M_bkt_num_key(__key);
+
+      for (const _Node* __first = _M_buckets[__n]; __first;
+	   __first = __first->_M_next)
+	{
+	  if (_M_equals(_M_get_key(__first->_M_val), __key))
+	    {
+	      for (const _Node* __cur = __first->_M_next; __cur;
+		   __cur = __cur->_M_next)
+		if (!_M_equals(_M_get_key(__cur->_M_val), __key))
+		  return _Pii(const_iterator(__first, this),
+			      const_iterator(__cur, this));
+	      for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
+		if (_M_buckets[__m])
+		  return _Pii(const_iterator(__first, this),
+			      const_iterator(_M_buckets[__m], this));
+	      return _Pii(const_iterator(__first, this), end());
+	    }
+	}
+      return _Pii(end(), end());
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::size_type
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    erase(const key_type& __key)
+    {
+      const size_type __n = _M_bkt_num_key(__key);
+      _Node* __first = _M_buckets[__n];
+      _Node* __saved_slot = 0;
+      size_type __erased = 0;
+
+      if (__first)
+	{
+	  _Node* __cur = __first;
+	  _Node* __next = __cur->_M_next;
+	  while (__next)
+	    {
+	      if (_M_equals(_M_get_key(__next->_M_val), __key))
+		{
+		  if (&_M_get_key(__next->_M_val) != &__key)
+		    {
+		      __cur->_M_next = __next->_M_next;
+		      _M_delete_node(__next);
+		      __next = __cur->_M_next;
+		      ++__erased;
+		      --_M_num_elements;
+		    }
+		  else
+		    {
+		      __saved_slot = __cur;
+		      __cur = __next;
+		      __next = __cur->_M_next;
+		    }
+		}
+	      else
+		{
+		  __cur = __next;
+		  __next = __cur->_M_next;
+		}
+	    }
+	  bool __delete_first = _M_equals(_M_get_key(__first->_M_val), __key);
+	  if (__saved_slot)
+	    {
+	      __next = __saved_slot->_M_next;
+	      __saved_slot->_M_next = __next->_M_next;
+	      _M_delete_node(__next);
+	      ++__erased;
+	      --_M_num_elements;
+	    }
+	  if (__delete_first)
+	    {
+	      _M_buckets[__n] = __first->_M_next;
+	      _M_delete_node(__first);
+	      ++__erased;
+	      --_M_num_elements;
+	    }
+	}
+      return __erased;
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    erase(const iterator& __it)
+    {
+      _Node* __p = __it._M_cur;
+      if (__p)
+	{
+	  const size_type __n = _M_bkt_num(__p->_M_val);
+	  _Node* __cur = _M_buckets[__n];
+	  
+	  if (__cur == __p)
+	    {
+	      _M_buckets[__n] = __cur->_M_next;
+	      _M_delete_node(__cur);
+	      --_M_num_elements;
+	    }
+	  else
+	    {
+	      _Node* __next = __cur->_M_next;
+	      while (__next)
+		{
+		  if (__next == __p)
+		    {
+		      __cur->_M_next = __next->_M_next;
+		      _M_delete_node(__next);
+		      --_M_num_elements;
+		      break;
+		    }
+		  else
+		    {
+		      __cur = __next;
+		      __next = __cur->_M_next;
+		    }
+		}
+	    }
+	}
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    erase(iterator __first, iterator __last)
+    {
+      size_type __f_bucket = __first._M_cur ? _M_bkt_num(__first._M_cur->_M_val)
+	                                    : _M_buckets.size();
+
+      size_type __l_bucket = __last._M_cur ? _M_bkt_num(__last._M_cur->_M_val)
+	                                   : _M_buckets.size();
+
+      if (__first._M_cur == __last._M_cur)
+	return;
+      else if (__f_bucket == __l_bucket)
+	_M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur);
+      else
+	{
+	  _M_erase_bucket(__f_bucket, __first._M_cur, 0);
+	  for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n)
+	    _M_erase_bucket(__n, 0);
+	  if (__l_bucket != _M_buckets.size())
+	    _M_erase_bucket(__l_bucket, __last._M_cur);
+	}
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    inline void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    erase(const_iterator __first, const_iterator __last)
+    {
+      erase(iterator(const_cast<_Node*>(__first._M_cur),
+		     const_cast<hashtable*>(__first._M_ht)),
+	    iterator(const_cast<_Node*>(__last._M_cur),
+		     const_cast<hashtable*>(__last._M_ht)));
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    inline void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    erase(const const_iterator& __it)
+    { erase(iterator(const_cast<_Node*>(__it._M_cur),
+		     const_cast<hashtable*>(__it._M_ht))); }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    resize(size_type __num_elements_hint)
+    {
+      const size_type __old_n = _M_buckets.size();
+      if (__num_elements_hint > __old_n)
+	{
+	  const size_type __n = _M_next_size(__num_elements_hint);
+	  if (__n > __old_n)
+	    {
+	      _Vector_type __tmp(__n, (_Node*)(0), _M_buckets.get_allocator());
+	      __try
+		{
+		  for (size_type __bucket = 0; __bucket < __old_n; ++__bucket)
+		    {
+		      _Node* __first = _M_buckets[__bucket];
+		      while (__first)
+			{
+			  size_type __new_bucket = _M_bkt_num(__first->_M_val,
+							      __n);
+			  _M_buckets[__bucket] = __first->_M_next;
+			  __first->_M_next = __tmp[__new_bucket];
+			  __tmp[__new_bucket] = __first;
+			  __first = _M_buckets[__bucket];
+			}
+		    }
+		  _M_buckets.swap(__tmp);
+		}
+	      __catch(...)
+		{
+		  for (size_type __bucket = 0; __bucket < __tmp.size();
+		       ++__bucket)
+		    {
+		      while (__tmp[__bucket])
+			{
+			  _Node* __next = __tmp[__bucket]->_M_next;
+			  _M_delete_node(__tmp[__bucket]);
+			  __tmp[__bucket] = __next;
+			}
+		    }
+		  __throw_exception_again;
+		}
+	    }
+	}
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last)
+    {
+      _Node* __cur = _M_buckets[__n];
+      if (__cur == __first)
+	_M_erase_bucket(__n, __last);
+      else
+	{
+	  _Node* __next;
+	  for (__next = __cur->_M_next;
+	       __next != __first;
+	       __cur = __next, __next = __cur->_M_next)
+	    ;
+	  while (__next != __last)
+	    {
+	      __cur->_M_next = __next->_M_next;
+	      _M_delete_node(__next);
+	      __next = __cur->_M_next;
+	      --_M_num_elements;
+	    }
+	}
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    _M_erase_bucket(const size_type __n, _Node* __last)
+    {
+      _Node* __cur = _M_buckets[__n];
+      while (__cur != __last)
+	{
+	  _Node* __next = __cur->_M_next;
+	  _M_delete_node(__cur);
+	  __cur = __next;
+	  _M_buckets[__n] = __cur;
+	  --_M_num_elements;
+	}
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    clear()
+    {
+      if (_M_num_elements == 0)
+	return;
+
+      for (size_type __i = 0; __i < _M_buckets.size(); ++__i)
+	{
+	  _Node* __cur = _M_buckets[__i];
+	  while (__cur != 0)
+	    {
+	      _Node* __next = __cur->_M_next;
+	      _M_delete_node(__cur);
+	      __cur = __next;
+	    }
+	  _M_buckets[__i] = 0;
+	}
+      _M_num_elements = 0;
+    }
+
+  template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+    void
+    hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+    _M_copy_from(const hashtable& __ht)
+    {
+      _M_buckets.clear();
+      _M_buckets.reserve(__ht._M_buckets.size());
+      _M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (_Node*) 0);
+      __try
+	{
+	  for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
+	    const _Node* __cur = __ht._M_buckets[__i];
+	    if (__cur)
+	      {
+		_Node* __local_copy = _M_new_node(__cur->_M_val);
+		_M_buckets[__i] = __local_copy;
+		
+		for (_Node* __next = __cur->_M_next;
+		     __next;
+		     __cur = __next, __next = __cur->_M_next)
+		  {
+		    __local_copy->_M_next = _M_new_node(__next->_M_val);
+		    __local_copy = __local_copy->_M_next;
+		  }
+	      }
+	  }
+	  _M_num_elements = __ht._M_num_elements;
+	}
+      __catch(...)
+	{
+	  clear();
+	  __throw_exception_again;
+	}
+    }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 182 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/backward/strstream

@@ -0,0 +1,182 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+// WARNING: The classes defined in this header are DEPRECATED.  This
+// header is defined in section D.7.1 of the C++ standard, and it
+// MAY BE REMOVED in a future standard revision.  One should use the
+// header <sstream> instead.
+
+/** @file strstream
+ *  This is a Standard C++ Library header.
+ */
+
+#ifndef _BACKWARD_STRSTREAM
+#define _BACKWARD_STRSTREAM
+
+#include "backward_warning.h"
+#include <iosfwd>
+#include <ios>
+#include <istream>
+#include <ostream>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Class strstreambuf, a streambuf class that manages an array of char.
+  // Note that this class is not a template.
+  class strstreambuf : public basic_streambuf<char, char_traits<char> >
+  {
+  public:
+    // Types.
+    typedef char_traits<char>              _Traits;
+    typedef basic_streambuf<char, _Traits> _Base;
+
+  public:
+    // Constructor, destructor
+    explicit strstreambuf(streamsize __initial_capacity = 0);
+    strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
+
+    strstreambuf(char* __get, streamsize __n, char* __put = 0) throw ();
+    strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0) throw ();
+    strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0) throw ();
+
+    strstreambuf(const char* __get, streamsize __n) throw ();
+    strstreambuf(const signed char* __get, streamsize __n) throw ();
+    strstreambuf(const unsigned char* __get, streamsize __n) throw ();
+
+    virtual ~strstreambuf();
+
+  public:
+    void freeze(bool = true) throw ();
+    char* str() throw ();
+    _GLIBCXX_PURE int pcount() const throw ();
+
+  protected:
+    virtual int_type overflow(int_type __c  = _Traits::eof());
+    virtual int_type pbackfail(int_type __c = _Traits::eof());
+    virtual int_type underflow();
+    virtual _Base* setbuf(char* __buf, streamsize __n);
+    virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
+			     ios_base::openmode __mode
+			     = ios_base::in | ios_base::out);
+    virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
+			     = ios_base::in | ios_base::out);
+
+  private:
+    strstreambuf&
+    operator=(const strstreambuf&);
+
+    strstreambuf(const strstreambuf&);
+
+    // Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
+    char* _M_alloc(size_t);
+    void  _M_free(char*);
+
+    // Helper function used in constructors.
+    void _M_setup(char* __get, char* __put, streamsize __n) throw ();
+
+  private:
+    // Data members.
+    void* (*_M_alloc_fun)(size_t);
+    void  (*_M_free_fun)(void*);
+
+    bool _M_dynamic  : 1;
+    bool _M_frozen   : 1;
+    bool _M_constant : 1;
+  };
+
+  // Class istrstream, an istream that manages a strstreambuf.
+  class istrstream : public basic_istream<char>
+  {
+  public:
+    explicit istrstream(char*);
+    explicit istrstream(const char*);
+    istrstream(char* , streamsize);
+    istrstream(const char*, streamsize);
+    virtual ~istrstream();
+
+    _GLIBCXX_CONST strstreambuf* rdbuf() const throw ();
+    char* str() throw ();
+
+  private:
+    strstreambuf _M_buf;
+  };
+
+  // Class ostrstream
+  class ostrstream : public basic_ostream<char>
+  {
+  public:
+    ostrstream();
+    ostrstream(char*, int, ios_base::openmode = ios_base::out);
+    virtual ~ostrstream();
+
+    _GLIBCXX_CONST strstreambuf* rdbuf() const throw ();
+    void freeze(bool = true) throw();
+    char* str() throw ();
+    _GLIBCXX_PURE int pcount() const throw ();
+
+  private:
+    strstreambuf _M_buf;
+  };
+
+  // Class strstream
+  class strstream : public basic_iostream<char>
+  {
+  public:
+    typedef char                        char_type;
+    typedef char_traits<char>::int_type int_type;
+    typedef char_traits<char>::pos_type pos_type;
+    typedef char_traits<char>::off_type off_type;
+
+    strstream();
+    strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
+    virtual ~strstream();
+
+    _GLIBCXX_CONST strstreambuf* rdbuf() const throw ();
+    void freeze(bool = true) throw ();
+    _GLIBCXX_PURE int pcount() const throw ();
+    char* str() throw ();
+
+  private:
+    strstreambuf _M_buf;
+  };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 855 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/algorithmfwd.h

@@ -0,0 +1,855 @@
+// <algorithm> Forward declarations  -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/algorithmfwd.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{algorithm}
+ */
+
+#ifndef _GLIBCXX_ALGORITHMFWD_H
+#define _GLIBCXX_ALGORITHMFWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_pair.h>
+#include <bits/stl_iterator_base_types.h>
+#if __cplusplus >= 201103L
+#include <initializer_list>
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /*
+    adjacent_find
+    all_of (C++11)
+    any_of (C++11)
+    binary_search
+    clamp (C++17)
+    copy
+    copy_backward
+    copy_if (C++11)
+    copy_n (C++11)
+    count
+    count_if
+    equal
+    equal_range
+    fill
+    fill_n
+    find
+    find_end
+    find_first_of
+    find_if
+    find_if_not (C++11)
+    for_each
+    generate
+    generate_n
+    includes
+    inplace_merge
+    is_heap (C++11)
+    is_heap_until (C++11)
+    is_partitioned (C++11)
+    is_sorted (C++11)
+    is_sorted_until (C++11)
+    iter_swap
+    lexicographical_compare
+    lower_bound
+    make_heap
+    max
+    max_element
+    merge
+    min
+    min_element
+    minmax (C++11)
+    minmax_element (C++11)
+    mismatch
+    next_permutation
+    none_of (C++11)
+    nth_element
+    partial_sort
+    partial_sort_copy
+    partition
+    partition_copy (C++11)
+    partition_point (C++11)
+    pop_heap
+    prev_permutation
+    push_heap
+    random_shuffle
+    remove
+    remove_copy
+    remove_copy_if
+    remove_if
+    replace
+    replace_copy
+    replace_copy_if
+    replace_if
+    reverse
+    reverse_copy
+    rotate
+    rotate_copy
+    search
+    search_n
+    set_difference
+    set_intersection
+    set_symmetric_difference
+    set_union
+    shuffle (C++11)
+    sort
+    sort_heap
+    stable_partition
+    stable_sort
+    swap
+    swap_ranges
+    transform
+    unique
+    unique_copy
+    upper_bound
+  */
+
+  /**
+   * @defgroup algorithms Algorithms
+   *
+   * Components for performing algorithmic operations. Includes
+   * non-modifying sequence, modifying (mutating) sequence, sorting,
+   * searching, merge, partition, heap, set, minima, maxima, and
+   * permutation operations.
+   */
+
+  /**
+   * @defgroup mutating_algorithms Mutating
+   * @ingroup algorithms
+   */
+
+  /**
+   * @defgroup non_mutating_algorithms Non-Mutating
+   * @ingroup algorithms
+   */
+
+  /**
+   * @defgroup sorting_algorithms Sorting
+   * @ingroup algorithms
+   */
+
+  /**
+   * @defgroup set_algorithms Set Operation
+   * @ingroup sorting_algorithms
+   *
+   * These algorithms are common set operations performed on sequences
+   * that are already sorted. The number of comparisons will be
+   * linear.
+   */
+
+  /**
+   * @defgroup binary_search_algorithms Binary Search
+   * @ingroup sorting_algorithms
+   *
+   * These algorithms are variations of a classic binary search, and
+   * all assume that the sequence being searched is already sorted.
+   *
+   * The number of comparisons will be logarithmic (and as few as
+   * possible).  The number of steps through the sequence will be
+   * logarithmic for random-access iterators (e.g., pointers), and
+   * linear otherwise.
+   *
+   * The LWG has passed Defect Report 270, which notes: <em>The
+   * proposed resolution reinterprets binary search. Instead of
+   * thinking about searching for a value in a sorted range, we view
+   * that as an important special case of a more general algorithm:
+   * searching for the partition point in a partitioned range.  We
+   * also add a guarantee that the old wording did not: we ensure that
+   * the upper bound is no earlier than the lower bound, that the pair
+   * returned by equal_range is a valid range, and that the first part
+   * of that pair is the lower bound.</em>
+   *
+   * The actual effect of the first sentence is that a comparison
+   * functor passed by the user doesn't necessarily need to induce a
+   * strict weak ordering relation.  Rather, it partitions the range.
+   */
+
+  // adjacent_find
+
+#if __cplusplus >= 201103L
+  template<typename _IIter, typename _Predicate>
+    bool
+    all_of(_IIter, _IIter, _Predicate);
+
+  template<typename _IIter, typename _Predicate>
+    bool
+    any_of(_IIter, _IIter, _Predicate);
+#endif
+
+  template<typename _FIter, typename _Tp>
+    bool
+    binary_search(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    bool
+    binary_search(_FIter, _FIter, const _Tp&, _Compare);
+
+#if __cplusplus > 201402L
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    const _Tp&
+    clamp(const _Tp&, const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    const _Tp&
+    clamp(const _Tp&, const _Tp&, const _Tp&, _Compare);
+#endif
+
+  template<typename _IIter, typename _OIter>
+    _OIter
+    copy(_IIter, _IIter, _OIter);
+
+  template<typename _BIter1, typename _BIter2>
+    _BIter2
+    copy_backward(_BIter1, _BIter1, _BIter2);
+
+#if __cplusplus >= 201103L
+  template<typename _IIter, typename _OIter, typename _Predicate>
+    _OIter
+    copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+  template<typename _IIter, typename _Size, typename _OIter>
+    _OIter
+    copy_n(_IIter, _Size, _OIter);
+#endif
+
+  // count
+  // count_if
+
+  template<typename _FIter, typename _Tp>
+    pair<_FIter, _FIter>
+    equal_range(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    pair<_FIter, _FIter>
+    equal_range(_FIter, _FIter, const _Tp&, _Compare);
+
+  template<typename _FIter, typename _Tp>
+    void
+    fill(_FIter, _FIter, const _Tp&);
+
+  template<typename _OIter, typename _Size, typename _Tp>
+    _OIter
+    fill_n(_OIter, _Size, const _Tp&);
+
+  // find
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter1
+    find_end(_FIter1, _FIter1, _FIter2, _FIter2);
+
+  template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+    _FIter1
+    find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+  // find_first_of
+  // find_if
+
+#if __cplusplus >= 201103L
+  template<typename _IIter, typename _Predicate>
+    _IIter
+    find_if_not(_IIter, _IIter, _Predicate);
+#endif
+
+  // for_each
+  // generate
+  // generate_n
+
+  template<typename _IIter1, typename _IIter2>
+    bool
+    includes(_IIter1, _IIter1, _IIter2, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _Compare>
+    bool
+    includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+  template<typename _BIter>
+    void
+    inplace_merge(_BIter, _BIter, _BIter);
+
+  template<typename _BIter, typename _Compare>
+    void
+    inplace_merge(_BIter, _BIter, _BIter, _Compare);
+
+#if __cplusplus >= 201103L
+  template<typename _RAIter>
+    bool
+    is_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    bool
+    is_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _RAIter>
+    _RAIter
+    is_heap_until(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    _RAIter
+    is_heap_until(_RAIter, _RAIter, _Compare);
+
+  template<typename _IIter, typename _Predicate>
+    bool
+    is_partitioned(_IIter, _IIter, _Predicate);
+
+  template<typename _FIter1, typename _FIter2>
+    bool
+    is_permutation(_FIter1, _FIter1, _FIter2);
+
+  template<typename _FIter1, typename _FIter2,
+	   typename _BinaryPredicate>
+    bool
+    is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
+
+  template<typename _FIter>
+    bool
+    is_sorted(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    bool
+    is_sorted(_FIter, _FIter, _Compare);
+
+  template<typename _FIter>
+    _FIter
+    is_sorted_until(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    _FIter
+    is_sorted_until(_FIter, _FIter, _Compare);
+#endif
+
+  template<typename _FIter1, typename _FIter2>
+    void
+    iter_swap(_FIter1, _FIter2);
+
+  template<typename _FIter, typename _Tp>
+    _FIter
+    lower_bound(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    _FIter
+    lower_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+  template<typename _RAIter>
+    void
+    make_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    make_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    const _Tp&
+    max(const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    const _Tp&
+    max(const _Tp&, const _Tp&, _Compare);
+
+  // max_element
+  // merge
+
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    const _Tp&
+    min(const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    const _Tp&
+    min(const _Tp&, const _Tp&, _Compare);
+
+  // min_element
+
+#if __cplusplus >= 201103L
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    pair<const _Tp&, const _Tp&>
+    minmax(const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    pair<const _Tp&, const _Tp&>
+    minmax(const _Tp&, const _Tp&, _Compare);
+
+  template<typename _FIter>
+    _GLIBCXX14_CONSTEXPR
+    pair<_FIter, _FIter>
+    minmax_element(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    pair<_FIter, _FIter>
+    minmax_element(_FIter, _FIter, _Compare);
+
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    _Tp
+    min(initializer_list<_Tp>);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    _Tp
+    min(initializer_list<_Tp>, _Compare);
+
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    _Tp
+    max(initializer_list<_Tp>);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    _Tp
+    max(initializer_list<_Tp>, _Compare);
+
+  template<typename _Tp>
+    _GLIBCXX14_CONSTEXPR
+    pair<_Tp, _Tp>
+    minmax(initializer_list<_Tp>);
+
+  template<typename _Tp, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    pair<_Tp, _Tp>
+    minmax(initializer_list<_Tp>, _Compare);
+#endif
+
+  // mismatch
+
+  template<typename _BIter>
+    bool
+    next_permutation(_BIter, _BIter);
+
+  template<typename _BIter, typename _Compare>
+    bool
+    next_permutation(_BIter, _BIter, _Compare);
+
+#if __cplusplus >= 201103L
+  template<typename _IIter, typename _Predicate>
+    bool
+    none_of(_IIter, _IIter, _Predicate);
+#endif
+
+  // nth_element
+  // partial_sort
+
+  template<typename _IIter, typename _RAIter>
+    _RAIter
+    partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
+
+  template<typename _IIter, typename _RAIter, typename _Compare>
+    _RAIter
+    partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
+
+  // partition
+
+#if __cplusplus >= 201103L
+  template<typename _IIter, typename _OIter1,
+	   typename _OIter2, typename _Predicate>
+    pair<_OIter1, _OIter2>
+    partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
+
+  template<typename _FIter, typename _Predicate>
+    _FIter
+    partition_point(_FIter, _FIter, _Predicate);
+#endif
+
+  template<typename _RAIter>
+    void
+    pop_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    pop_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _BIter>
+    bool
+    prev_permutation(_BIter, _BIter);
+
+  template<typename _BIter, typename _Compare>
+    bool
+    prev_permutation(_BIter, _BIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    push_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    push_heap(_RAIter, _RAIter, _Compare);
+
+  // random_shuffle
+
+  template<typename _FIter, typename _Tp>
+    _FIter
+    remove(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Predicate>
+    _FIter
+    remove_if(_FIter, _FIter, _Predicate);
+
+  template<typename _IIter, typename _OIter, typename _Tp>
+    _OIter
+    remove_copy(_IIter, _IIter, _OIter, const _Tp&);
+
+  template<typename _IIter, typename _OIter, typename _Predicate>
+    _OIter
+    remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+  // replace
+
+  template<typename _IIter, typename _OIter, typename _Tp>
+    _OIter
+    replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
+
+  template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
+    _OIter
+    replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
+
+  // replace_if
+
+  template<typename _BIter>
+    void
+    reverse(_BIter, _BIter);
+
+  template<typename _BIter, typename _OIter>
+    _OIter
+    reverse_copy(_BIter, _BIter, _OIter);
+
+  inline namespace _V2
+  {
+    template<typename _FIter>
+      _FIter
+      rotate(_FIter, _FIter, _FIter);
+  }
+
+  template<typename _FIter, typename _OIter>
+    _OIter
+    rotate_copy(_FIter, _FIter, _FIter, _OIter);
+
+  // search
+  // search_n
+  // set_difference
+  // set_intersection
+  // set_symmetric_difference
+  // set_union
+
+#if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+  template<typename _RAIter, typename _UGenerator>
+    void
+    shuffle(_RAIter, _RAIter, _UGenerator&&);
+#endif
+
+  template<typename _RAIter>
+    void
+    sort_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    sort_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _BIter, typename _Predicate>
+    _BIter
+    stable_partition(_BIter, _BIter, _Predicate);
+
+#if __cplusplus < 201103L
+  // For C++11 swap() is declared in <type_traits>.
+
+  template<typename _Tp, size_t _Nm>
+    inline void
+    swap(_Tp& __a, _Tp& __b);
+
+  template<typename _Tp, size_t _Nm>
+    inline void
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]);
+#endif
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter2
+    swap_ranges(_FIter1, _FIter1, _FIter2);
+
+  // transform
+
+  template<typename _FIter>
+    _FIter
+    unique(_FIter, _FIter);
+
+  template<typename _FIter, typename _BinaryPredicate>
+    _FIter
+    unique(_FIter, _FIter, _BinaryPredicate);
+
+  // unique_copy
+
+  template<typename _FIter, typename _Tp>
+    _FIter
+    upper_bound(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    _FIter
+    upper_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+_GLIBCXX_END_NAMESPACE_VERSION
+
+_GLIBCXX_BEGIN_NAMESPACE_ALGO
+
+  template<typename _FIter>
+    _FIter
+    adjacent_find(_FIter, _FIter);
+
+  template<typename _FIter, typename _BinaryPredicate>
+    _FIter
+    adjacent_find(_FIter, _FIter, _BinaryPredicate);
+
+  template<typename _IIter, typename _Tp>
+    typename iterator_traits<_IIter>::difference_type
+    count(_IIter, _IIter, const _Tp&);
+
+  template<typename _IIter, typename _Predicate>
+    typename iterator_traits<_IIter>::difference_type
+    count_if(_IIter, _IIter, _Predicate);
+
+  template<typename _IIter1, typename _IIter2>
+    bool
+    equal(_IIter1, _IIter1, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+    bool
+    equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+  template<typename _IIter, typename _Tp>
+    _IIter
+    find(_IIter, _IIter, const _Tp&);
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter1
+    find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
+
+  template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+    _FIter1
+    find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+  template<typename _IIter, typename _Predicate>
+    _IIter
+    find_if(_IIter, _IIter, _Predicate);
+
+  template<typename _IIter, typename _Funct>
+    _Funct
+    for_each(_IIter, _IIter, _Funct);
+
+  template<typename _FIter, typename _Generator>
+    void
+    generate(_FIter, _FIter, _Generator);
+
+  template<typename _OIter, typename _Size, typename _Generator>
+    _OIter
+    generate_n(_OIter, _Size, _Generator);
+
+  template<typename _IIter1, typename _IIter2>
+    bool
+    lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _Compare>
+    bool
+    lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+  template<typename _FIter>
+    _GLIBCXX14_CONSTEXPR
+    _FIter
+    max_element(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    _FIter
+    max_element(_FIter, _FIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+	   typename _Compare>
+    _OIter
+    merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _FIter>
+    _GLIBCXX14_CONSTEXPR
+    _FIter
+    min_element(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    _GLIBCXX14_CONSTEXPR
+    _FIter
+    min_element(_FIter, _FIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2>
+    pair<_IIter1, _IIter2>
+    mismatch(_IIter1, _IIter1, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+    pair<_IIter1, _IIter2>
+    mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+  template<typename _RAIter>
+    void
+    nth_element(_RAIter, _RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    nth_element(_RAIter, _RAIter, _RAIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    partial_sort(_RAIter, _RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
+
+  template<typename _BIter, typename _Predicate>
+    _BIter
+    partition(_BIter, _BIter, _Predicate);
+
+  template<typename _RAIter>
+    void
+    random_shuffle(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Generator>
+    void
+    random_shuffle(_RAIter, _RAIter,
+#if __cplusplus >= 201103L
+		   _Generator&&);
+#else
+		   _Generator&);
+#endif
+
+  template<typename _FIter, typename _Tp>
+    void
+    replace(_FIter, _FIter, const _Tp&, const _Tp&);
+
+  template<typename _FIter, typename _Predicate, typename _Tp>
+    void
+    replace_if(_FIter, _FIter, _Predicate, const _Tp&);
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter1
+    search(_FIter1, _FIter1, _FIter2, _FIter2);
+
+  template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+    _FIter1
+    search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+  template<typename _FIter, typename _Size, typename _Tp>
+    _FIter
+    search_n(_FIter, _FIter, _Size, const _Tp&);
+
+  template<typename _FIter, typename _Size, typename _Tp,
+	   typename _BinaryPredicate>
+    _FIter
+    search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+	   typename _Compare>
+    _OIter
+    set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+	   typename _Compare>
+    _OIter
+    set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+	   typename _Compare>
+    _OIter
+    set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
+			     _OIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+	   typename _Compare>
+    _OIter
+    set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    sort(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    sort(_RAIter, _RAIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    stable_sort(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    stable_sort(_RAIter, _RAIter, _Compare);
+
+  template<typename _IIter, typename _OIter, typename _UnaryOperation>
+    _OIter
+    transform(_IIter, _IIter, _OIter, _UnaryOperation);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+	   typename _BinaryOperation>
+    _OIter
+    transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
+
+  template<typename _IIter, typename _OIter>
+    _OIter
+    unique_copy(_IIter, _IIter, _OIter);
+
+  template<typename _IIter, typename _OIter, typename _BinaryPredicate>
+    _OIter
+    unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
+
+_GLIBCXX_END_NAMESPACE_ALGO
+} // namespace std
+
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algorithmfwd.h>
+#endif
+
+#endif
+

+ 605 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/alloc_traits.h

@@ -0,0 +1,605 @@
+// Allocator traits -*- C++ -*-
+
+// Copyright (C) 2011-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/alloc_traits.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{memory}
+ */
+
+#ifndef _ALLOC_TRAITS_H
+#define _ALLOC_TRAITS_H 1
+
+#if __cplusplus >= 201103L
+
+#include <bits/memoryfwd.h>
+#include <bits/ptr_traits.h>
+#include <ext/numeric_traits.h>
+
+#define __cpp_lib_allocator_traits_is_always_equal 201411
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  struct __allocator_traits_base
+  {
+    template<typename _Tp, typename _Up, typename = void>
+      struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
+    template<typename _Tp, typename _Up>
+      struct __rebind<_Tp, _Up,
+		      __void_t<typename _Tp::template rebind<_Up>::other>>
+      { using type = typename _Tp::template rebind<_Up>::other; };
+
+  protected:
+    template<typename _Tp>
+      using __pointer = typename _Tp::pointer;
+    template<typename _Tp>
+      using __c_pointer = typename _Tp::const_pointer;
+    template<typename _Tp>
+      using __v_pointer = typename _Tp::void_pointer;
+    template<typename _Tp>
+      using __cv_pointer = typename _Tp::const_void_pointer;
+    template<typename _Tp>
+      using __pocca = typename _Tp::propagate_on_container_copy_assignment;
+    template<typename _Tp>
+      using __pocma = typename _Tp::propagate_on_container_move_assignment;
+    template<typename _Tp>
+      using __pocs = typename _Tp::propagate_on_container_swap;
+    template<typename _Tp>
+      using __equal = typename _Tp::is_always_equal;
+  };
+
+  template<typename _Alloc, typename _Up>
+    using __alloc_rebind
+      = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type;
+
+  /**
+   * @brief  Uniform interface to all allocator types.
+   * @ingroup allocators
+  */
+  template<typename _Alloc>
+    struct allocator_traits : __allocator_traits_base
+    {
+      /// The allocator type
+      typedef _Alloc allocator_type;
+      /// The allocated type
+      typedef typename _Alloc::value_type value_type;
+
+      /**
+       * @brief   The allocator's pointer type.
+       *
+       * @c Alloc::pointer if that type exists, otherwise @c value_type*
+      */
+      using pointer = __detected_or_t<value_type*, __pointer, _Alloc>;
+
+    private:
+      // Select _Func<_Alloc> or pointer_traits<pointer>::rebind<_Tp>
+      template<template<typename> class _Func, typename _Tp, typename = void>
+	struct _Ptr
+	{
+	  using type = typename pointer_traits<pointer>::template rebind<_Tp>;
+	};
+
+      template<template<typename> class _Func, typename _Tp>
+	struct _Ptr<_Func, _Tp, __void_t<_Func<_Alloc>>>
+	{
+	  using type = _Func<_Alloc>;
+	};
+
+      // Select _A2::difference_type or pointer_traits<_Ptr>::difference_type
+      template<typename _A2, typename _PtrT, typename = void>
+	struct _Diff
+	{ using type = typename pointer_traits<_PtrT>::difference_type; };
+
+      template<typename _A2, typename _PtrT>
+	struct _Diff<_A2, _PtrT, __void_t<typename _A2::difference_type>>
+	{ using type = typename _A2::difference_type; };
+
+      // Select _A2::size_type or make_unsigned<_DiffT>::type
+      template<typename _A2, typename _DiffT, typename = void>
+	struct _Size : make_unsigned<_DiffT> { };
+
+      template<typename _A2, typename _DiffT>
+	struct _Size<_A2, _DiffT, __void_t<typename _A2::size_type>>
+	{ using type = typename _A2::size_type; };
+
+    public:
+      /**
+       * @brief   The allocator's const pointer type.
+       *
+       * @c Alloc::const_pointer if that type exists, otherwise
+       * <tt> pointer_traits<pointer>::rebind<const value_type> </tt>
+      */
+      using const_pointer = typename _Ptr<__c_pointer, const value_type>::type;
+
+      /**
+       * @brief   The allocator's void pointer type.
+       *
+       * @c Alloc::void_pointer if that type exists, otherwise
+       * <tt> pointer_traits<pointer>::rebind<void> </tt>
+      */
+      using void_pointer = typename _Ptr<__v_pointer, void>::type;
+
+      /**
+       * @brief   The allocator's const void pointer type.
+       *
+       * @c Alloc::const_void_pointer if that type exists, otherwise
+       * <tt> pointer_traits<pointer>::rebind<const void> </tt>
+      */
+      using const_void_pointer = typename _Ptr<__cv_pointer, const void>::type;
+
+      /**
+       * @brief   The allocator's difference type
+       *
+       * @c Alloc::difference_type if that type exists, otherwise
+       * <tt> pointer_traits<pointer>::difference_type </tt>
+      */
+      using difference_type = typename _Diff<_Alloc, pointer>::type;
+
+      /**
+       * @brief   The allocator's size type
+       *
+       * @c Alloc::size_type if that type exists, otherwise
+       * <tt> make_unsigned<difference_type>::type </tt>
+      */
+      using size_type = typename _Size<_Alloc, difference_type>::type;
+
+      /**
+       * @brief   How the allocator is propagated on copy assignment
+       *
+       * @c Alloc::propagate_on_container_copy_assignment if that type exists,
+       * otherwise @c false_type
+      */
+      using propagate_on_container_copy_assignment
+	= __detected_or_t<false_type, __pocca, _Alloc>;
+
+      /**
+       * @brief   How the allocator is propagated on move assignment
+       *
+       * @c Alloc::propagate_on_container_move_assignment if that type exists,
+       * otherwise @c false_type
+      */
+      using propagate_on_container_move_assignment
+	= __detected_or_t<false_type, __pocma, _Alloc>;
+
+      /**
+       * @brief   How the allocator is propagated on swap
+       *
+       * @c Alloc::propagate_on_container_swap if that type exists,
+       * otherwise @c false_type
+      */
+      using propagate_on_container_swap
+	= __detected_or_t<false_type, __pocs, _Alloc>;
+
+      /**
+       * @brief   Whether all instances of the allocator type compare equal.
+       *
+       * @c Alloc::is_always_equal if that type exists,
+       * otherwise @c is_empty<Alloc>::type
+      */
+      using is_always_equal
+	= __detected_or_t<typename is_empty<_Alloc>::type, __equal, _Alloc>;
+
+      template<typename _Tp>
+	using rebind_alloc = __alloc_rebind<_Alloc, _Tp>;
+      template<typename _Tp>
+	using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
+
+    private:
+      template<typename _Alloc2>
+	static auto
+	_S_allocate(_Alloc2& __a, size_type __n, const_void_pointer __hint, int)
+	-> decltype(__a.allocate(__n, __hint))
+	{ return __a.allocate(__n, __hint); }
+
+      template<typename _Alloc2>
+	static pointer
+	_S_allocate(_Alloc2& __a, size_type __n, const_void_pointer, ...)
+	{ return __a.allocate(__n); }
+
+      template<typename _Tp, typename... _Args>
+	struct __construct_helper
+	{
+	  template<typename _Alloc2,
+	    typename = decltype(std::declval<_Alloc2*>()->construct(
+		  std::declval<_Tp*>(), std::declval<_Args>()...))>
+	    static true_type __test(int);
+
+	  template<typename>
+	    static false_type __test(...);
+
+	  using type = decltype(__test<_Alloc>(0));
+	};
+
+      template<typename _Tp, typename... _Args>
+	using __has_construct
+	  = typename __construct_helper<_Tp, _Args...>::type;
+
+      template<typename _Tp, typename... _Args>
+	static _Require<__has_construct<_Tp, _Args...>>
+	_S_construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
+	{ __a.construct(__p, std::forward<_Args>(__args)...); }
+
+      template<typename _Tp, typename... _Args>
+	static
+	_Require<__and_<__not_<__has_construct<_Tp, _Args...>>,
+			       is_constructible<_Tp, _Args...>>>
+	_S_construct(_Alloc&, _Tp* __p, _Args&&... __args)
+	{ ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); }
+
+      template<typename _Alloc2, typename _Tp>
+	static auto
+	_S_destroy(_Alloc2& __a, _Tp* __p, int)
+	-> decltype(__a.destroy(__p))
+	{ __a.destroy(__p); }
+
+      template<typename _Alloc2, typename _Tp>
+	static void
+	_S_destroy(_Alloc2&, _Tp* __p, ...)
+	{ __p->~_Tp(); }
+
+      template<typename _Alloc2>
+	static auto
+	_S_max_size(_Alloc2& __a, int)
+	-> decltype(__a.max_size())
+	{ return __a.max_size(); }
+
+      template<typename _Alloc2>
+	static size_type
+	_S_max_size(_Alloc2&, ...)
+	{
+	  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	  // 2466. allocator_traits::max_size() default behavior is incorrect
+	  return __gnu_cxx::__numeric_traits<size_type>::__max
+	    / sizeof(value_type);
+	}
+
+      template<typename _Alloc2>
+	static auto
+	_S_select(_Alloc2& __a, int)
+	-> decltype(__a.select_on_container_copy_construction())
+	{ return __a.select_on_container_copy_construction(); }
+
+      template<typename _Alloc2>
+	static _Alloc2
+	_S_select(_Alloc2& __a, ...)
+	{ return __a; }
+
+    public:
+
+      /**
+       *  @brief  Allocate memory.
+       *  @param  __a  An allocator.
+       *  @param  __n  The number of objects to allocate space for.
+       *
+       *  Calls @c a.allocate(n)
+      */
+      static pointer
+      allocate(_Alloc& __a, size_type __n)
+      { return __a.allocate(__n); }
+
+      /**
+       *  @brief  Allocate memory.
+       *  @param  __a  An allocator.
+       *  @param  __n  The number of objects to allocate space for.
+       *  @param  __hint Aid to locality.
+       *  @return Memory of suitable size and alignment for @a n objects
+       *          of type @c value_type
+       *
+       *  Returns <tt> a.allocate(n, hint) </tt> if that expression is
+       *  well-formed, otherwise returns @c a.allocate(n)
+      */
+      static pointer
+      allocate(_Alloc& __a, size_type __n, const_void_pointer __hint)
+      { return _S_allocate(__a, __n, __hint, 0); }
+
+      /**
+       *  @brief  Deallocate memory.
+       *  @param  __a  An allocator.
+       *  @param  __p  Pointer to the memory to deallocate.
+       *  @param  __n  The number of objects space was allocated for.
+       *
+       *  Calls <tt> a.deallocate(p, n) </tt>
+      */
+      static void
+      deallocate(_Alloc& __a, pointer __p, size_type __n)
+      { __a.deallocate(__p, __n); }
+
+      /**
+       *  @brief  Construct an object of type @a _Tp
+       *  @param  __a  An allocator.
+       *  @param  __p  Pointer to memory of suitable size and alignment for Tp
+       *  @param  __args Constructor arguments.
+       *
+       *  Calls <tt> __a.construct(__p, std::forward<Args>(__args)...) </tt>
+       *  if that expression is well-formed, otherwise uses placement-new
+       *  to construct an object of type @a _Tp at location @a __p from the
+       *  arguments @a __args...
+      */
+      template<typename _Tp, typename... _Args>
+	static auto construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
+	-> decltype(_S_construct(__a, __p, std::forward<_Args>(__args)...))
+	{ _S_construct(__a, __p, std::forward<_Args>(__args)...); }
+
+      /**
+       *  @brief  Destroy an object of type @a _Tp
+       *  @param  __a  An allocator.
+       *  @param  __p  Pointer to the object to destroy
+       *
+       *  Calls @c __a.destroy(__p) if that expression is well-formed,
+       *  otherwise calls @c __p->~_Tp()
+      */
+      template<typename _Tp>
+	static void destroy(_Alloc& __a, _Tp* __p)
+	{ _S_destroy(__a, __p, 0); }
+
+      /**
+       *  @brief  The maximum supported allocation size
+       *  @param  __a  An allocator.
+       *  @return @c __a.max_size() or @c numeric_limits<size_type>::max()
+       *
+       *  Returns @c __a.max_size() if that expression is well-formed,
+       *  otherwise returns @c numeric_limits<size_type>::max()
+      */
+      static size_type max_size(const _Alloc& __a) noexcept
+      { return _S_max_size(__a, 0); }
+
+      /**
+       *  @brief  Obtain an allocator to use when copying a container.
+       *  @param  __rhs  An allocator.
+       *  @return @c __rhs.select_on_container_copy_construction() or @a __rhs
+       *
+       *  Returns @c __rhs.select_on_container_copy_construction() if that
+       *  expression is well-formed, otherwise returns @a __rhs
+      */
+      static _Alloc
+      select_on_container_copy_construction(const _Alloc& __rhs)
+      { return _S_select(__rhs, 0); }
+    };
+
+  /// Partial specialization for std::allocator.
+  template<typename _Tp>
+    struct allocator_traits<allocator<_Tp>>
+    {
+      /// The allocator type
+      using allocator_type = allocator<_Tp>;
+      /// The allocated type
+      using value_type = _Tp;
+
+      /// The allocator's pointer type.
+      using pointer = _Tp*;
+
+      /// The allocator's const pointer type.
+      using const_pointer = const _Tp*;
+
+      /// The allocator's void pointer type.
+      using void_pointer = void*;
+
+      /// The allocator's const void pointer type.
+      using const_void_pointer = const void*;
+
+      /// The allocator's difference type
+      using difference_type = std::ptrdiff_t;
+
+      /// The allocator's size type
+      using size_type = std::size_t;
+
+      /// How the allocator is propagated on copy assignment
+      using propagate_on_container_copy_assignment = false_type;
+
+      /// How the allocator is propagated on move assignment
+      using propagate_on_container_move_assignment = true_type;
+
+      /// How the allocator is propagated on swap
+      using propagate_on_container_swap = false_type;
+
+      /// Whether all instances of the allocator type compare equal.
+      using is_always_equal = true_type;
+
+      template<typename _Up>
+	using rebind_alloc = allocator<_Up>;
+
+      template<typename _Up>
+	using rebind_traits = allocator_traits<allocator<_Up>>;
+
+      /**
+       *  @brief  Allocate memory.
+       *  @param  __a  An allocator.
+       *  @param  __n  The number of objects to allocate space for.
+       *
+       *  Calls @c a.allocate(n)
+      */
+      static pointer
+      allocate(allocator_type& __a, size_type __n)
+      { return __a.allocate(__n); }
+
+      /**
+       *  @brief  Allocate memory.
+       *  @param  __a  An allocator.
+       *  @param  __n  The number of objects to allocate space for.
+       *  @param  __hint Aid to locality.
+       *  @return Memory of suitable size and alignment for @a n objects
+       *          of type @c value_type
+       *
+       *  Returns <tt> a.allocate(n, hint) </tt>
+      */
+      static pointer
+      allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
+      { return __a.allocate(__n, __hint); }
+
+      /**
+       *  @brief  Deallocate memory.
+       *  @param  __a  An allocator.
+       *  @param  __p  Pointer to the memory to deallocate.
+       *  @param  __n  The number of objects space was allocated for.
+       *
+       *  Calls <tt> a.deallocate(p, n) </tt>
+      */
+      static void
+      deallocate(allocator_type& __a, pointer __p, size_type __n)
+      { __a.deallocate(__p, __n); }
+
+      /**
+       *  @brief  Construct an object of type @a _Up
+       *  @param  __a  An allocator.
+       *  @param  __p  Pointer to memory of suitable size and alignment for Tp
+       *  @param  __args Constructor arguments.
+       *
+       *  Calls <tt> __a.construct(__p, std::forward<Args>(__args)...) </tt>
+      */
+      template<typename _Up, typename... _Args>
+	static void
+	construct(allocator_type& __a, _Up* __p, _Args&&... __args)
+	{ __a.construct(__p, std::forward<_Args>(__args)...); }
+
+      /**
+       *  @brief  Destroy an object of type @a _Up
+       *  @param  __a  An allocator.
+       *  @param  __p  Pointer to the object to destroy
+       *
+       *  Calls @c __a.destroy(__p).
+      */
+      template<typename _Up>
+	static void
+	destroy(allocator_type& __a, _Up* __p)
+	{ __a.destroy(__p); }
+
+      /**
+       *  @brief  The maximum supported allocation size
+       *  @param  __a  An allocator.
+       *  @return @c __a.max_size()
+      */
+      static size_type
+      max_size(const allocator_type& __a) noexcept
+      { return __a.max_size(); }
+
+      /**
+       *  @brief  Obtain an allocator to use when copying a container.
+       *  @param  __rhs  An allocator.
+       *  @return @c __rhs
+      */
+      static allocator_type
+      select_on_container_copy_construction(const allocator_type& __rhs)
+      { return __rhs; }
+    };
+
+
+  template<typename _Alloc>
+    inline void
+    __do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type)
+    { __one = __two; }
+
+  template<typename _Alloc>
+    inline void
+    __do_alloc_on_copy(_Alloc&, const _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_copy(_Alloc& __one, const _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_copy_assignment __pocca;
+      __do_alloc_on_copy(__one, __two, __pocca());
+    }
+
+  template<typename _Alloc>
+    inline _Alloc __alloc_on_copy(const _Alloc& __a)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      return __traits::select_on_container_copy_construction(__a);
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_move(_Alloc& __one, _Alloc& __two, true_type)
+    { __one = std::move(__two); }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_move(_Alloc&, _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_move(_Alloc& __one, _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_move_assignment __pocma;
+      __do_alloc_on_move(__one, __two, __pocma());
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_swap(_Alloc& __one, _Alloc& __two, true_type)
+    {
+      using std::swap;
+      swap(__one, __two);
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_swap(_Alloc&, _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_swap(_Alloc& __one, _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_swap __pocs;
+      __do_alloc_on_swap(__one, __two, __pocs());
+    }
+
+  template<typename _Alloc>
+    class __is_copy_insertable_impl
+    {
+      typedef allocator_traits<_Alloc> _Traits;
+
+      template<typename _Up, typename
+	       = decltype(_Traits::construct(std::declval<_Alloc&>(),
+					     std::declval<_Up*>(),
+					     std::declval<const _Up&>()))>
+	static true_type
+	_M_select(int);
+
+      template<typename _Up>
+	static false_type
+	_M_select(...);
+
+    public:
+      typedef decltype(_M_select<typename _Alloc::value_type>(0)) type;
+    };
+
+  // true if _Alloc::value_type is CopyInsertable into containers using _Alloc
+  template<typename _Alloc>
+    struct __is_copy_insertable
+    : __is_copy_insertable_impl<_Alloc>::type
+    { };
+
+  // std::allocator<_Tp> just requires CopyConstructible
+  template<typename _Tp>
+    struct __is_copy_insertable<allocator<_Tp>>
+    : is_copy_constructible<_Tp>
+    { };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif
+#endif

+ 111 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/allocated_ptr.h

@@ -0,0 +1,111 @@
+// Guarded Allocation -*- C++ -*-
+
+// Copyright (C) 2014-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/allocated_ptr.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{memory}
+ */
+
+#ifndef _ALLOCATED_PTR_H
+#define _ALLOCATED_PTR_H 1
+
+#if __cplusplus < 201103L
+# include <bits/c++0xwarning.h>
+#else
+# include <type_traits>
+# include <bits/ptr_traits.h>
+# include <bits/alloc_traits.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /// Non-standard RAII type for managing pointers obtained from allocators.
+  template<typename _Alloc>
+    struct __allocated_ptr
+    {
+      using pointer = typename allocator_traits<_Alloc>::pointer;
+      using value_type = typename allocator_traits<_Alloc>::value_type;
+
+      /// Take ownership of __ptr
+      __allocated_ptr(_Alloc& __a, pointer __ptr) noexcept
+      : _M_alloc(std::__addressof(__a)), _M_ptr(__ptr)
+      { }
+
+      /// Convert __ptr to allocator's pointer type and take ownership of it
+      template<typename _Ptr,
+	       typename _Req = _Require<is_same<_Ptr, value_type*>>>
+      __allocated_ptr(_Alloc& __a, _Ptr __ptr)
+      : _M_alloc(std::__addressof(__a)),
+	_M_ptr(pointer_traits<pointer>::pointer_to(*__ptr))
+      { }
+
+      /// Transfer ownership of the owned pointer
+      __allocated_ptr(__allocated_ptr&& __gd) noexcept
+      : _M_alloc(__gd._M_alloc), _M_ptr(__gd._M_ptr)
+      { __gd._M_ptr = nullptr; }
+
+      /// Deallocate the owned pointer
+      ~__allocated_ptr()
+      {
+	if (_M_ptr != nullptr)
+	  std::allocator_traits<_Alloc>::deallocate(*_M_alloc, _M_ptr, 1);
+      }
+
+      /// Release ownership of the owned pointer
+      __allocated_ptr&
+      operator=(std::nullptr_t) noexcept
+      {
+	_M_ptr = nullptr;
+	return *this;
+      }
+
+      /// Get the address that the owned pointer refers to.
+      value_type* get() { return _S_raw_ptr(_M_ptr); }
+
+    private:
+      static value_type* _S_raw_ptr(value_type* __ptr) { return __ptr; }
+
+      template<typename _Ptr>
+	static auto
+	_S_raw_ptr(_Ptr __ptr) -> decltype(_S_raw_ptr(__ptr.operator->()))
+	{ return _S_raw_ptr(__ptr.operator->()); }
+
+      _Alloc* _M_alloc;
+      pointer _M_ptr;
+    };
+
+  /// Allocate space for a single object using __a
+  template<typename _Alloc>
+    __allocated_ptr<_Alloc>
+    __allocate_guarded(_Alloc& __a)
+    {
+      return { __a, std::allocator_traits<_Alloc>::allocate(__a, 1) };
+    }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif
+#endif

+ 247 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/allocator.h

@@ -0,0 +1,247 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file bits/allocator.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{memory}
+ */
+
+#ifndef _ALLOCATOR_H
+#define _ALLOCATOR_H 1
+
+#include <bits/c++allocator.h> // Define the base class to std::allocator.
+#include <bits/memoryfwd.h>
+#if __cplusplus >= 201103L
+#include <type_traits>
+#endif
+
+#define __cpp_lib_incomplete_container_elements 201505
+#if __cplusplus >= 201103L
+# define __cpp_lib_allocator_is_always_equal 201411
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @addtogroup allocators
+   *  @{
+   */
+
+  /// allocator<void> specialization.
+  template<>
+    class allocator<void>
+    {
+    public:
+      typedef size_t      size_type;
+      typedef ptrdiff_t   difference_type;
+      typedef void*       pointer;
+      typedef const void* const_pointer;
+      typedef void        value_type;
+
+      template<typename _Tp1>
+	struct rebind
+	{ typedef allocator<_Tp1> other; };
+
+#if __cplusplus >= 201103L
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2103. std::allocator propagate_on_container_move_assignment
+      typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
+
+      template<typename _Up, typename... _Args>
+	void
+	construct(_Up* __p, _Args&&... __args)
+	{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
+
+      template<typename _Up>
+	void
+	destroy(_Up* __p) { __p->~_Up(); }
+#endif
+    };
+
+  /**
+   * @brief  The @a standard allocator, as per [20.4].
+   *
+   *  See https://gcc.gnu.org/onlinedocs/libstdc++/manual/memory.html#std.util.memory.allocator
+   *  for further details.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+   */
+  template<typename _Tp>
+    class allocator: public __allocator_base<_Tp>
+    {
+   public:
+      typedef size_t     size_type;
+      typedef ptrdiff_t  difference_type;
+      typedef _Tp*       pointer;
+      typedef const _Tp* const_pointer;
+      typedef _Tp&       reference;
+      typedef const _Tp& const_reference;
+      typedef _Tp        value_type;
+
+      template<typename _Tp1>
+	struct rebind
+	{ typedef allocator<_Tp1> other; };
+
+#if __cplusplus >= 201103L
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2103. std::allocator propagate_on_container_move_assignment
+      typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
+#endif
+
+      allocator() throw() { }
+
+      allocator(const allocator& __a) throw()
+      : __allocator_base<_Tp>(__a) { }
+
+      template<typename _Tp1>
+	allocator(const allocator<_Tp1>&) throw() { }
+
+      ~allocator() throw() { }
+
+      // Inherit everything else.
+    };
+
+  template<typename _T1, typename _T2>
+    inline bool
+    operator==(const allocator<_T1>&, const allocator<_T2>&)
+    _GLIBCXX_USE_NOEXCEPT
+    { return true; }
+
+  template<typename _Tp>
+    inline bool
+    operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+    _GLIBCXX_USE_NOEXCEPT
+    { return true; }
+
+  template<typename _T1, typename _T2>
+    inline bool
+    operator!=(const allocator<_T1>&, const allocator<_T2>&)
+    _GLIBCXX_USE_NOEXCEPT
+    { return false; }
+
+  template<typename _Tp>
+    inline bool
+    operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+    _GLIBCXX_USE_NOEXCEPT
+    { return false; }
+
+  /// @} group allocator
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class allocator<char>;
+  extern template class allocator<wchar_t>;
+#endif
+
+  // Undefine.
+#undef __allocator_base
+
+  // To implement Option 3 of DR 431.
+  template<typename _Alloc, bool = __is_empty(_Alloc)>
+    struct __alloc_swap
+    { static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
+
+  template<typename _Alloc>
+    struct __alloc_swap<_Alloc, false>
+    {
+      static void
+      _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
+      {
+	// Precondition: swappable allocators.
+	if (__one != __two)
+	  swap(__one, __two);
+      }
+    };
+
+  // Optimize for stateless allocators.
+  template<typename _Alloc, bool = __is_empty(_Alloc)>
+    struct __alloc_neq
+    {
+      static bool
+      _S_do_it(const _Alloc&, const _Alloc&)
+      { return false; }
+    };
+
+  template<typename _Alloc>
+    struct __alloc_neq<_Alloc, false>
+    {
+      static bool
+      _S_do_it(const _Alloc& __one, const _Alloc& __two)
+      { return __one != __two; }
+    };
+
+#if __cplusplus >= 201103L
+  template<typename _Tp, bool
+    = __or_<is_copy_constructible<typename _Tp::value_type>,
+            is_nothrow_move_constructible<typename _Tp::value_type>>::value>
+    struct __shrink_to_fit_aux
+    { static bool _S_do_it(_Tp&) noexcept { return false; } };
+
+  template<typename _Tp>
+    struct __shrink_to_fit_aux<_Tp, true>
+    {
+      static bool
+      _S_do_it(_Tp& __c) noexcept
+      {
+#if __cpp_exceptions
+	try
+	  {
+	    _Tp(__make_move_if_noexcept_iterator(__c.begin()),
+		__make_move_if_noexcept_iterator(__c.end()),
+		__c.get_allocator()).swap(__c);
+	    return true;
+	  }
+	catch(...)
+	  { return false; }
+#else
+	return false;
+#endif
+      }
+    };
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 796 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/atomic_base.h

@@ -0,0 +1,796 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_base.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{atomic}
+ */
+
+#ifndef _GLIBCXX_ATOMIC_BASE_H
+#define _GLIBCXX_ATOMIC_BASE_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <stdint.h>
+#include <bits/atomic_lockfree_defines.h>
+
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @defgroup atomics Atomics
+   *
+   * Components for performing atomic operations.
+   * @{
+   */
+
+  /// Enumeration for memory_order
+  typedef enum memory_order
+    {
+      memory_order_relaxed,
+      memory_order_consume,
+      memory_order_acquire,
+      memory_order_release,
+      memory_order_acq_rel,
+      memory_order_seq_cst
+    } memory_order;
+
+  enum __memory_order_modifier
+    {
+      __memory_order_mask          = 0x0ffff,
+      __memory_order_modifier_mask = 0xffff0000,
+      __memory_order_hle_acquire   = 0x10000,
+      __memory_order_hle_release   = 0x20000
+    };
+
+  constexpr memory_order
+  operator|(memory_order __m, __memory_order_modifier __mod)
+  {
+    return memory_order(__m | int(__mod));
+  }
+
+  constexpr memory_order
+  operator&(memory_order __m, __memory_order_modifier __mod)
+  {
+    return memory_order(__m & int(__mod));
+  }
+
+  // Drop release ordering as per [atomics.types.operations.req]/21
+  constexpr memory_order
+  __cmpexch_failure_order2(memory_order __m) noexcept
+  {
+    return __m == memory_order_acq_rel ? memory_order_acquire
+      : __m == memory_order_release ? memory_order_relaxed : __m;
+  }
+
+  constexpr memory_order
+  __cmpexch_failure_order(memory_order __m) noexcept
+  {
+    return memory_order(__cmpexch_failure_order2(__m & __memory_order_mask)
+      | (__m & __memory_order_modifier_mask));
+  }
+
+  _GLIBCXX_ALWAYS_INLINE void
+  atomic_thread_fence(memory_order __m) noexcept
+  { __atomic_thread_fence(__m); }
+
+  _GLIBCXX_ALWAYS_INLINE void
+  atomic_signal_fence(memory_order __m) noexcept
+  { __atomic_signal_fence(__m); }
+
+  /// kill_dependency
+  template<typename _Tp>
+    inline _Tp
+    kill_dependency(_Tp __y) noexcept
+    {
+      _Tp __ret(__y);
+      return __ret;
+    }
+
+
+  // Base types for atomics.
+  template<typename _IntTp>
+    struct __atomic_base;
+
+
+#define ATOMIC_VAR_INIT(_VI) { _VI }
+
+  template<typename _Tp>
+    struct atomic;
+
+  template<typename _Tp>
+    struct atomic<_Tp*>;
+
+    /* The target's "set" value for test-and-set may not be exactly 1.  */
+#if __GCC_ATOMIC_TEST_AND_SET_TRUEVAL == 1
+    typedef bool __atomic_flag_data_type;
+#else
+    typedef unsigned char __atomic_flag_data_type;
+#endif
+
+  /**
+   *  @brief Base type for atomic_flag.
+   *
+   *  Base type is POD with data, allowing atomic_flag to derive from
+   *  it and meet the standard layout type requirement. In addition to
+   *  compatibility with a C interface, this allows different
+   *  implementations of atomic_flag to use the same atomic operation
+   *  functions, via a standard conversion to the __atomic_flag_base
+   *  argument.
+  */
+  _GLIBCXX_BEGIN_EXTERN_C
+
+  struct __atomic_flag_base
+  {
+    __atomic_flag_data_type _M_i;
+  };
+
+  _GLIBCXX_END_EXTERN_C
+
+#define ATOMIC_FLAG_INIT { 0 }
+
+  /// atomic_flag
+  struct atomic_flag : public __atomic_flag_base
+  {
+    atomic_flag() noexcept = default;
+    ~atomic_flag() noexcept = default;
+    atomic_flag(const atomic_flag&) = delete;
+    atomic_flag& operator=(const atomic_flag&) = delete;
+    atomic_flag& operator=(const atomic_flag&) volatile = delete;
+
+    // Conversion to ATOMIC_FLAG_INIT.
+    constexpr atomic_flag(bool __i) noexcept
+      : __atomic_flag_base{ _S_init(__i) }
+    { }
+
+    _GLIBCXX_ALWAYS_INLINE bool
+    test_and_set(memory_order __m = memory_order_seq_cst) noexcept
+    {
+      return __atomic_test_and_set (&_M_i, __m);
+    }
+
+    _GLIBCXX_ALWAYS_INLINE bool
+    test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept
+    {
+      return __atomic_test_and_set (&_M_i, __m);
+    }
+
+    _GLIBCXX_ALWAYS_INLINE void
+    clear(memory_order __m = memory_order_seq_cst) noexcept
+    {
+      memory_order __b = __m & __memory_order_mask;
+      __glibcxx_assert(__b != memory_order_consume);
+      __glibcxx_assert(__b != memory_order_acquire);
+      __glibcxx_assert(__b != memory_order_acq_rel);
+
+      __atomic_clear (&_M_i, __m);
+    }
+
+    _GLIBCXX_ALWAYS_INLINE void
+    clear(memory_order __m = memory_order_seq_cst) volatile noexcept
+    {
+      memory_order __b = __m & __memory_order_mask;
+      __glibcxx_assert(__b != memory_order_consume);
+      __glibcxx_assert(__b != memory_order_acquire);
+      __glibcxx_assert(__b != memory_order_acq_rel);
+
+      __atomic_clear (&_M_i, __m);
+    }
+
+  private:
+    static constexpr __atomic_flag_data_type
+    _S_init(bool __i)
+    { return __i ? __GCC_ATOMIC_TEST_AND_SET_TRUEVAL : 0; }
+  };
+
+
+  /// Base class for atomic integrals.
+  //
+  // For each of the integral types, define atomic_[integral type] struct
+  //
+  // atomic_bool     bool
+  // atomic_char     char
+  // atomic_schar    signed char
+  // atomic_uchar    unsigned char
+  // atomic_short    short
+  // atomic_ushort   unsigned short
+  // atomic_int      int
+  // atomic_uint     unsigned int
+  // atomic_long     long
+  // atomic_ulong    unsigned long
+  // atomic_llong    long long
+  // atomic_ullong   unsigned long long
+  // atomic_char16_t char16_t
+  // atomic_char32_t char32_t
+  // atomic_wchar_t  wchar_t
+  //
+  // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or
+  // 8 bytes, since that is what GCC built-in functions for atomic
+  // memory access expect.
+  template<typename _ITp>
+    struct __atomic_base
+    {
+    private:
+      typedef _ITp 	__int_type;
+
+      static constexpr int _S_alignment =
+	sizeof(_ITp) > alignof(_ITp) ? sizeof(_ITp) : alignof(_ITp);
+
+      alignas(_S_alignment) __int_type _M_i;
+
+    public:
+      __atomic_base() noexcept = default;
+      ~__atomic_base() noexcept = default;
+      __atomic_base(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) volatile = delete;
+
+      // Requires __int_type convertible to _M_i.
+      constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
+
+      operator __int_type() const noexcept
+      { return load(); }
+
+      operator __int_type() const volatile noexcept
+      { return load(); }
+
+      __int_type
+      operator=(__int_type __i) noexcept
+      {
+	store(__i);
+	return __i;
+      }
+
+      __int_type
+      operator=(__int_type __i) volatile noexcept
+      {
+	store(__i);
+	return __i;
+      }
+
+      __int_type
+      operator++(int) noexcept
+      { return fetch_add(1); }
+
+      __int_type
+      operator++(int) volatile noexcept
+      { return fetch_add(1); }
+
+      __int_type
+      operator--(int) noexcept
+      { return fetch_sub(1); }
+
+      __int_type
+      operator--(int) volatile noexcept
+      { return fetch_sub(1); }
+
+      __int_type
+      operator++() noexcept
+      { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator++() volatile noexcept
+      { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator--() noexcept
+      { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator--() volatile noexcept
+      { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator+=(__int_type __i) noexcept
+      { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator+=(__int_type __i) volatile noexcept
+      { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator-=(__int_type __i) noexcept
+      { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator-=(__int_type __i) volatile noexcept
+      { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator&=(__int_type __i) noexcept
+      { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator&=(__int_type __i) volatile noexcept
+      { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator|=(__int_type __i) noexcept
+      { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator|=(__int_type __i) volatile noexcept
+      { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator^=(__int_type __i) noexcept
+      { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator^=(__int_type __i) volatile noexcept
+      { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      bool
+      is_lock_free() const noexcept
+      {
+	// Use a fake, minimally aligned pointer.
+	return __atomic_is_lock_free(sizeof(_M_i),
+	    reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+      bool
+      is_lock_free() const volatile noexcept
+      {
+	// Use a fake, minimally aligned pointer.
+	return __atomic_is_lock_free(sizeof(_M_i),
+	    reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+      _GLIBCXX_ALWAYS_INLINE void
+      store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_acquire);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+	__glibcxx_assert(__b != memory_order_consume);
+
+	__atomic_store_n(&_M_i, __i, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE void
+      store(__int_type __i,
+	    memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_acquire);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+	__glibcxx_assert(__b != memory_order_consume);
+
+	__atomic_store_n(&_M_i, __i, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_release);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+
+	return __atomic_load_n(&_M_i, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_release);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+
+	return __atomic_load_n(&_M_i, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      exchange(__int_type __i,
+	       memory_order __m = memory_order_seq_cst) noexcept
+      {
+	return __atomic_exchange_n(&_M_i, __i, __m);
+      }
+
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      exchange(__int_type __i,
+	       memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	return __atomic_exchange_n(&_M_i, __i, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+			    memory_order __m1, memory_order __m2) noexcept
+      {
+	memory_order __b2 = __m2 & __memory_order_mask;
+	memory_order __b1 = __m1 & __memory_order_mask;
+	__glibcxx_assert(__b2 != memory_order_release);
+	__glibcxx_assert(__b2 != memory_order_acq_rel);
+	__glibcxx_assert(__b2 <= __b1);
+
+	return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+			    memory_order __m1,
+			    memory_order __m2) volatile noexcept
+      {
+	memory_order __b2 = __m2 & __memory_order_mask;
+	memory_order __b1 = __m1 & __memory_order_mask;
+	__glibcxx_assert(__b2 != memory_order_release);
+	__glibcxx_assert(__b2 != memory_order_acq_rel);
+	__glibcxx_assert(__b2 <= __b1);
+
+	return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+			    memory_order __m = memory_order_seq_cst) noexcept
+      {
+	return compare_exchange_weak(__i1, __i2, __m,
+				     __cmpexch_failure_order(__m));
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+		   memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	return compare_exchange_weak(__i1, __i2, __m,
+				     __cmpexch_failure_order(__m));
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+			      memory_order __m1, memory_order __m2) noexcept
+      {
+	memory_order __b2 = __m2 & __memory_order_mask;
+	memory_order __b1 = __m1 & __memory_order_mask;
+	__glibcxx_assert(__b2 != memory_order_release);
+	__glibcxx_assert(__b2 != memory_order_acq_rel);
+	__glibcxx_assert(__b2 <= __b1);
+
+	return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+			      memory_order __m1,
+			      memory_order __m2) volatile noexcept
+      {
+	memory_order __b2 = __m2 & __memory_order_mask;
+	memory_order __b1 = __m1 & __memory_order_mask;
+
+	__glibcxx_assert(__b2 != memory_order_release);
+	__glibcxx_assert(__b2 != memory_order_acq_rel);
+	__glibcxx_assert(__b2 <= __b1);
+
+	return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+			      memory_order __m = memory_order_seq_cst) noexcept
+      {
+	return compare_exchange_strong(__i1, __i2, __m,
+				       __cmpexch_failure_order(__m));
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+		 memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	return compare_exchange_strong(__i1, __i2, __m,
+				       __cmpexch_failure_order(__m));
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_add(__int_type __i,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_add(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_add(__int_type __i,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_add(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_sub(__int_type __i,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_sub(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_sub(__int_type __i,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_sub(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_and(__int_type __i,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_and(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_and(__int_type __i,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_and(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_or(__int_type __i,
+	       memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_or(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_or(__int_type __i,
+	       memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_or(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_xor(__int_type __i,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_xor(&_M_i, __i, __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __int_type
+      fetch_xor(__int_type __i,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_xor(&_M_i, __i, __m); }
+    };
+
+
+  /// Partial specialization for pointer types.
+  template<typename _PTp>
+    struct __atomic_base<_PTp*>
+    {
+    private:
+      typedef _PTp* 	__pointer_type;
+
+      __pointer_type 	_M_p;
+
+      // Factored out to facilitate explicit specialization.
+      constexpr ptrdiff_t
+      _M_type_size(ptrdiff_t __d) const { return __d * sizeof(_PTp); }
+
+      constexpr ptrdiff_t
+      _M_type_size(ptrdiff_t __d) const volatile { return __d * sizeof(_PTp); }
+
+    public:
+      __atomic_base() noexcept = default;
+      ~__atomic_base() noexcept = default;
+      __atomic_base(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) volatile = delete;
+
+      // Requires __pointer_type convertible to _M_p.
+      constexpr __atomic_base(__pointer_type __p) noexcept : _M_p (__p) { }
+
+      operator __pointer_type() const noexcept
+      { return load(); }
+
+      operator __pointer_type() const volatile noexcept
+      { return load(); }
+
+      __pointer_type
+      operator=(__pointer_type __p) noexcept
+      {
+	store(__p);
+	return __p;
+      }
+
+      __pointer_type
+      operator=(__pointer_type __p) volatile noexcept
+      {
+	store(__p);
+	return __p;
+      }
+
+      __pointer_type
+      operator++(int) noexcept
+      { return fetch_add(1); }
+
+      __pointer_type
+      operator++(int) volatile noexcept
+      { return fetch_add(1); }
+
+      __pointer_type
+      operator--(int) noexcept
+      { return fetch_sub(1); }
+
+      __pointer_type
+      operator--(int) volatile noexcept
+      { return fetch_sub(1); }
+
+      __pointer_type
+      operator++() noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(1),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator++() volatile noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(1),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator--() noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(1),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator--() volatile noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(1),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(__d),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) volatile noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(__d),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(__d),
+				  memory_order_seq_cst); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) volatile noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(__d),
+				  memory_order_seq_cst); }
+
+      bool
+      is_lock_free() const noexcept
+      {
+	// Produce a fake, minimally aligned pointer.
+	return __atomic_is_lock_free(sizeof(_M_p),
+	    reinterpret_cast<void *>(-__alignof(_M_p)));
+      }
+
+      bool
+      is_lock_free() const volatile noexcept
+      {
+	// Produce a fake, minimally aligned pointer.
+	return __atomic_is_lock_free(sizeof(_M_p),
+	    reinterpret_cast<void *>(-__alignof(_M_p)));
+      }
+
+      _GLIBCXX_ALWAYS_INLINE void
+      store(__pointer_type __p,
+	    memory_order __m = memory_order_seq_cst) noexcept
+      {
+        memory_order __b = __m & __memory_order_mask;
+
+	__glibcxx_assert(__b != memory_order_acquire);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+	__glibcxx_assert(__b != memory_order_consume);
+
+	__atomic_store_n(&_M_p, __p, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE void
+      store(__pointer_type __p,
+	    memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_acquire);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+	__glibcxx_assert(__b != memory_order_consume);
+
+	__atomic_store_n(&_M_p, __p, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_release);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+
+	return __atomic_load_n(&_M_p, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      {
+	memory_order __b = __m & __memory_order_mask;
+	__glibcxx_assert(__b != memory_order_release);
+	__glibcxx_assert(__b != memory_order_acq_rel);
+
+	return __atomic_load_n(&_M_p, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      exchange(__pointer_type __p,
+	       memory_order __m = memory_order_seq_cst) noexcept
+      {
+	return __atomic_exchange_n(&_M_p, __p, __m);
+      }
+
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      exchange(__pointer_type __p,
+	       memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+	return __atomic_exchange_n(&_M_p, __p, __m);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+			      memory_order __m1,
+			      memory_order __m2) noexcept
+      {
+	memory_order __b2 = __m2 & __memory_order_mask;
+	memory_order __b1 = __m1 & __memory_order_mask;
+	__glibcxx_assert(__b2 != memory_order_release);
+	__glibcxx_assert(__b2 != memory_order_acq_rel);
+	__glibcxx_assert(__b2 <= __b1);
+
+	return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+			      memory_order __m1,
+			      memory_order __m2) volatile noexcept
+      {
+	memory_order __b2 = __m2 & __memory_order_mask;
+	memory_order __b1 = __m1 & __memory_order_mask;
+
+	__glibcxx_assert(__b2 != memory_order_release);
+	__glibcxx_assert(__b2 != memory_order_acq_rel);
+	__glibcxx_assert(__b2 <= __b1);
+
+	return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+      }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      fetch_add(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_add(&_M_p, _M_type_size(__d), __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      fetch_add(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_add(&_M_p, _M_type_size(__d), __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      fetch_sub(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_sub(&_M_p, _M_type_size(__d), __m); }
+
+      _GLIBCXX_ALWAYS_INLINE __pointer_type
+      fetch_sub(ptrdiff_t __d,
+		memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_sub(&_M_p, _M_type_size(__d), __m); }
+    };
+
+  // @} group atomics
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 290 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/atomic_futex.h

@@ -0,0 +1,290 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2015-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_futex.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_FUTEX_H
+#define _GLIBCXX_ATOMIC_FUTEX_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <atomic>
+#include <chrono>
+#if ! (defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1)
+#include <mutex>
+#include <condition_variable>
+#endif
+
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+#if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
+  struct __atomic_futex_unsigned_base
+  {
+    // Returns false iff a timeout occurred.
+    bool
+    _M_futex_wait_until(unsigned *__addr, unsigned __val, bool __has_timeout,
+	chrono::seconds __s, chrono::nanoseconds __ns);
+
+    // This can be executed after the object has been destroyed.
+    static void _M_futex_notify_all(unsigned* __addr);
+  };
+
+  template <unsigned _Waiter_bit = 0x80000000>
+  class __atomic_futex_unsigned : __atomic_futex_unsigned_base
+  {
+    typedef chrono::system_clock __clock_t;
+
+    // This must be lock-free and at offset 0.
+    atomic<unsigned> _M_data;
+
+  public:
+    explicit
+    __atomic_futex_unsigned(unsigned __data) : _M_data(__data)
+    { }
+
+    _GLIBCXX_ALWAYS_INLINE unsigned
+    _M_load(memory_order __mo)
+    {
+      return _M_data.load(__mo) & ~_Waiter_bit;
+    }
+
+  private:
+    // If a timeout occurs, returns a current value after the timeout;
+    // otherwise, returns the operand's value if equal is true or a different
+    // value if equal is false.
+    // The assumed value is the caller's assumption about the current value
+    // when making the call.
+    unsigned
+    _M_load_and_test_until(unsigned __assumed, unsigned __operand,
+	bool __equal, memory_order __mo, bool __has_timeout,
+	chrono::seconds __s, chrono::nanoseconds __ns)
+    {
+      for (;;)
+	{
+	  // Don't bother checking the value again because we expect the caller
+	  // to have done it recently.
+	  // memory_order_relaxed is sufficient because we can rely on just the
+	  // modification order (store_notify uses an atomic RMW operation too),
+	  // and the futex syscalls synchronize between themselves.
+	  _M_data.fetch_or(_Waiter_bit, memory_order_relaxed);
+	  bool __ret = _M_futex_wait_until((unsigned*)(void*)&_M_data,
+					   __assumed | _Waiter_bit,
+					   __has_timeout, __s, __ns);
+	  // Fetch the current value after waiting (clears _Waiter_bit).
+	  __assumed = _M_load(__mo);
+	  if (!__ret || ((__operand == __assumed) == __equal))
+	    return __assumed;
+	  // TODO adapt wait time
+	}
+    }
+
+    // Returns the operand's value if equal is true or a different value if
+    // equal is false.
+    // The assumed value is the caller's assumption about the current value
+    // when making the call.
+    unsigned
+    _M_load_and_test(unsigned __assumed, unsigned __operand,
+	bool __equal, memory_order __mo)
+    {
+      return _M_load_and_test_until(__assumed, __operand, __equal, __mo,
+				    false, {}, {});
+    }
+
+    // If a timeout occurs, returns a current value after the timeout;
+    // otherwise, returns the operand's value if equal is true or a different
+    // value if equal is false.
+    // The assumed value is the caller's assumption about the current value
+    // when making the call.
+    template<typename _Dur>
+    unsigned
+    _M_load_and_test_until_impl(unsigned __assumed, unsigned __operand,
+	bool __equal, memory_order __mo,
+	const chrono::time_point<__clock_t, _Dur>& __atime)
+    {
+      auto __s = chrono::time_point_cast<chrono::seconds>(__atime);
+      auto __ns = chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+      // XXX correct?
+      return _M_load_and_test_until(__assumed, __operand, __equal, __mo,
+	  true, __s.time_since_epoch(), __ns);
+    }
+
+  public:
+
+    _GLIBCXX_ALWAYS_INLINE unsigned
+    _M_load_when_not_equal(unsigned __val, memory_order __mo)
+    {
+      unsigned __i = _M_load(__mo);
+      if ((__i & ~_Waiter_bit) != __val)
+	return (__i & ~_Waiter_bit);
+      // TODO Spin-wait first.
+      return _M_load_and_test(__i, __val, false, __mo);
+    }
+
+    _GLIBCXX_ALWAYS_INLINE void
+    _M_load_when_equal(unsigned __val, memory_order __mo)
+    {
+      unsigned __i = _M_load(__mo);
+      if ((__i & ~_Waiter_bit) == __val)
+	return;
+      // TODO Spin-wait first.
+      _M_load_and_test(__i, __val, true, __mo);
+    }
+
+    // Returns false iff a timeout occurred.
+    template<typename _Rep, typename _Period>
+      _GLIBCXX_ALWAYS_INLINE bool
+      _M_load_when_equal_for(unsigned __val, memory_order __mo,
+	  const chrono::duration<_Rep, _Period>& __rtime)
+      {
+	return _M_load_when_equal_until(__val, __mo,
+					__clock_t::now() + __rtime);
+      }
+
+    // Returns false iff a timeout occurred.
+    template<typename _Clock, typename _Duration>
+      _GLIBCXX_ALWAYS_INLINE bool
+      _M_load_when_equal_until(unsigned __val, memory_order __mo,
+	  const chrono::time_point<_Clock, _Duration>& __atime)
+      {
+	// DR 887 - Sync unknown clock to known clock.
+	const typename _Clock::time_point __c_entry = _Clock::now();
+	const __clock_t::time_point __s_entry = __clock_t::now();
+	const auto __delta = __atime - __c_entry;
+	const auto __s_atime = __s_entry + __delta;
+	return _M_load_when_equal_until(__val, __mo, __s_atime);
+      }
+
+    // Returns false iff a timeout occurred.
+    template<typename _Duration>
+    _GLIBCXX_ALWAYS_INLINE bool
+    _M_load_when_equal_until(unsigned __val, memory_order __mo,
+	const chrono::time_point<__clock_t, _Duration>& __atime)
+    {
+      unsigned __i = _M_load(__mo);
+      if ((__i & ~_Waiter_bit) == __val)
+	return true;
+      // TODO Spin-wait first.  Ignore effect on timeout.
+      __i = _M_load_and_test_until_impl(__i, __val, true, __mo, __atime);
+      return (__i & ~_Waiter_bit) == __val;
+    }
+
+    _GLIBCXX_ALWAYS_INLINE void
+    _M_store_notify_all(unsigned __val, memory_order __mo)
+    {
+      unsigned* __futex = (unsigned *)(void *)&_M_data;
+      if (_M_data.exchange(__val, __mo) & _Waiter_bit)
+	_M_futex_notify_all(__futex);
+    }
+  };
+
+#else // ! (_GLIBCXX_HAVE_LINUX_FUTEX && ATOMIC_INT_LOCK_FREE > 1)
+
+  // If futexes are not available, use a mutex and a condvar to wait.
+  // Because we access the data only within critical sections, all accesses
+  // are sequentially consistent; thus, we satisfy any provided memory_order.
+  template <unsigned _Waiter_bit = 0x80000000>
+  class __atomic_futex_unsigned
+  {
+    typedef chrono::system_clock __clock_t;
+
+    unsigned _M_data;
+    mutex _M_mutex;
+    condition_variable _M_condvar;
+
+  public:
+    explicit
+    __atomic_futex_unsigned(unsigned __data) : _M_data(__data)
+    { }
+
+    _GLIBCXX_ALWAYS_INLINE unsigned
+    _M_load(memory_order __mo)
+    {
+      unique_lock<mutex> __lock(_M_mutex);
+      return _M_data;
+    }
+
+    _GLIBCXX_ALWAYS_INLINE unsigned
+    _M_load_when_not_equal(unsigned __val, memory_order __mo)
+    {
+      unique_lock<mutex> __lock(_M_mutex);
+      while (_M_data == __val)
+	_M_condvar.wait(__lock);
+      return _M_data;
+    }
+
+    _GLIBCXX_ALWAYS_INLINE void
+    _M_load_when_equal(unsigned __val, memory_order __mo)
+    {
+      unique_lock<mutex> __lock(_M_mutex);
+      while (_M_data != __val)
+	_M_condvar.wait(__lock);
+    }
+
+    template<typename _Rep, typename _Period>
+      _GLIBCXX_ALWAYS_INLINE bool
+      _M_load_when_equal_for(unsigned __val, memory_order __mo,
+	  const chrono::duration<_Rep, _Period>& __rtime)
+      {
+	unique_lock<mutex> __lock(_M_mutex);
+	return _M_condvar.wait_for(__lock, __rtime,
+				   [&] { return _M_data == __val;});
+      }
+
+    template<typename _Clock, typename _Duration>
+      _GLIBCXX_ALWAYS_INLINE bool
+      _M_load_when_equal_until(unsigned __val, memory_order __mo,
+	  const chrono::time_point<_Clock, _Duration>& __atime)
+      {
+	unique_lock<mutex> __lock(_M_mutex);
+	return _M_condvar.wait_until(__lock, __atime,
+				     [&] { return _M_data == __val;});
+      }
+
+    _GLIBCXX_ALWAYS_INLINE void
+    _M_store_notify_all(unsigned __val, memory_order __mo)
+    {
+      unique_lock<mutex> __lock(_M_mutex);
+      _M_data = __val;
+      _M_condvar.notify_all();
+    }
+  };
+
+#endif // _GLIBCXX_HAVE_LINUX_FUTEX && ATOMIC_INT_LOCK_FREE > 1
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 63 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/atomic_lockfree_defines.h

@@ -0,0 +1,63 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_lockfree_defines.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{atomic}
+ */
+
+#ifndef _GLIBCXX_ATOMIC_LOCK_FREE_H
+#define _GLIBCXX_ATOMIC_LOCK_FREE_H 1
+
+#pragma GCC system_header
+
+/**
+ * @addtogroup atomics
+ * @{
+ */
+
+/**
+ * Lock-free property.
+ *
+ * 0 indicates that the types are never lock-free.
+ * 1 indicates that the types are sometimes lock-free.
+ * 2 indicates that the types are always lock-free.
+ */
+
+#if __cplusplus >= 201103L
+#define ATOMIC_BOOL_LOCK_FREE		__GCC_ATOMIC_BOOL_LOCK_FREE
+#define ATOMIC_CHAR_LOCK_FREE		__GCC_ATOMIC_CHAR_LOCK_FREE
+#define ATOMIC_WCHAR_T_LOCK_FREE	__GCC_ATOMIC_WCHAR_T_LOCK_FREE
+#define ATOMIC_CHAR16_T_LOCK_FREE	__GCC_ATOMIC_CHAR16_T_LOCK_FREE
+#define ATOMIC_CHAR32_T_LOCK_FREE	__GCC_ATOMIC_CHAR32_T_LOCK_FREE
+#define ATOMIC_SHORT_LOCK_FREE		__GCC_ATOMIC_SHORT_LOCK_FREE
+#define ATOMIC_INT_LOCK_FREE		__GCC_ATOMIC_INT_LOCK_FREE
+#define ATOMIC_LONG_LOCK_FREE		__GCC_ATOMIC_LONG_LOCK_FREE
+#define ATOMIC_LLONG_LOCK_FREE		__GCC_ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_POINTER_LOCK_FREE	__GCC_ATOMIC_POINTER_LOCK_FREE
+#endif
+
+// @} group atomics
+
+#endif

+ 518 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_ios.h

@@ -0,0 +1,518 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/basic_ios.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ios}
+ */
+
+#ifndef _BASIC_IOS_H
+#define _BASIC_IOS_H 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+#include <bits/locale_facets.h>
+#include <bits/streambuf_iterator.h>
+#include <bits/move.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _Facet>
+    inline const _Facet&
+    __check_facet(const _Facet* __f)
+    {
+      if (!__f)
+	__throw_bad_cast();
+      return *__f;
+    }
+
+  /**
+   *  @brief Template class basic_ios, virtual base class for all
+   *  stream classes. 
+   *  @ingroup io
+   *
+   *  @tparam _CharT  Type of character stream.
+   *  @tparam _Traits  Traits for character type, defaults to
+   *                   char_traits<_CharT>.
+   *
+   *  Most of the member functions called dispatched on stream objects
+   *  (e.g., @c std::cout.foo(bar);) are consolidated in this class.
+  */
+  template<typename _CharT, typename _Traits>
+    class basic_ios : public ios_base
+    {
+    public:
+      //@{
+      /**
+       *  These are standard types.  They permit a standardized way of
+       *  referring to names of (or names dependent on) the template
+       *  parameters, which are specific to the implementation.
+      */
+      typedef _CharT                                 char_type;
+      typedef typename _Traits::int_type             int_type;
+      typedef typename _Traits::pos_type             pos_type;
+      typedef typename _Traits::off_type             off_type;
+      typedef _Traits                                traits_type;
+      //@}
+
+      //@{
+      /**
+       *  These are non-standard types.
+      */
+      typedef ctype<_CharT>                          __ctype_type;
+      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+						     __num_put_type;
+      typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+						     __num_get_type;
+      //@}
+
+      // Data members:
+    protected:
+      basic_ostream<_CharT, _Traits>*                _M_tie;
+      mutable char_type                              _M_fill;
+      mutable bool                                   _M_fill_init;
+      basic_streambuf<_CharT, _Traits>*              _M_streambuf;
+
+      // Cached use_facet<ctype>, which is based on the current locale info.
+      const __ctype_type*                            _M_ctype;
+      // For ostream.
+      const __num_put_type*                          _M_num_put;
+      // For istream.
+      const __num_get_type*                          _M_num_get;
+
+    public:
+      //@{
+      /**
+       *  @brief  The quick-and-easy status check.
+       *
+       *  This allows you to write constructs such as
+       *  <code>if (!a_stream) ...</code> and <code>while (a_stream) ...</code>
+      */
+#if __cplusplus >= 201103L
+      explicit operator bool() const
+      { return !this->fail(); }
+#else
+      operator void*() const
+      { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+#endif
+
+      bool
+      operator!() const
+      { return this->fail(); }
+      //@}
+
+      /**
+       *  @brief  Returns the error state of the stream buffer.
+       *  @return  A bit pattern (well, isn't everything?)
+       *
+       *  See std::ios_base::iostate for the possible bit values.  Most
+       *  users will call one of the interpreting wrappers, e.g., good().
+      */
+      iostate
+      rdstate() const
+      { return _M_streambuf_state; }
+
+      /**
+       *  @brief  [Re]sets the error state.
+       *  @param  __state  The new state flag(s) to set.
+       *
+       *  See std::ios_base::iostate for the possible bit values.  Most
+       *  users will not need to pass an argument.
+      */
+      void
+      clear(iostate __state = goodbit);
+
+      /**
+       *  @brief  Sets additional flags in the error state.
+       *  @param  __state  The additional state flag(s) to set.
+       *
+       *  See std::ios_base::iostate for the possible bit values.
+      */
+      void
+      setstate(iostate __state)
+      { this->clear(this->rdstate() | __state); }
+
+      // Flip the internal state on for the proper state bits, then
+      // rethrows the propagated exception if bit also set in
+      // exceptions().
+      void
+      _M_setstate(iostate __state)
+      {
+	// 27.6.1.2.1 Common requirements.
+	// Turn this on without causing an ios::failure to be thrown.
+	_M_streambuf_state |= __state;
+	if (this->exceptions() & __state)
+	  __throw_exception_again;
+      }
+
+      /**
+       *  @brief  Fast error checking.
+       *  @return  True if no error flags are set.
+       *
+       *  A wrapper around rdstate.
+      */
+      bool
+      good() const
+      { return this->rdstate() == 0; }
+
+      /**
+       *  @brief  Fast error checking.
+       *  @return  True if the eofbit is set.
+       *
+       *  Note that other iostate flags may also be set.
+      */
+      bool
+      eof() const
+      { return (this->rdstate() & eofbit) != 0; }
+
+      /**
+       *  @brief  Fast error checking.
+       *  @return  True if either the badbit or the failbit is set.
+       *
+       *  Checking the badbit in fail() is historical practice.
+       *  Note that other iostate flags may also be set.
+      */
+      bool
+      fail() const
+      { return (this->rdstate() & (badbit | failbit)) != 0; }
+
+      /**
+       *  @brief  Fast error checking.
+       *  @return  True if the badbit is set.
+       *
+       *  Note that other iostate flags may also be set.
+      */
+      bool
+      bad() const
+      { return (this->rdstate() & badbit) != 0; }
+
+      /**
+       *  @brief  Throwing exceptions on errors.
+       *  @return  The current exceptions mask.
+       *
+       *  This changes nothing in the stream.  See the one-argument version
+       *  of exceptions(iostate) for the meaning of the return value.
+      */
+      iostate
+      exceptions() const
+      { return _M_exception; }
+
+      /**
+       *  @brief  Throwing exceptions on errors.
+       *  @param  __except  The new exceptions mask.
+       *
+       *  By default, error flags are set silently.  You can set an
+       *  exceptions mask for each stream; if a bit in the mask becomes set
+       *  in the error flags, then an exception of type
+       *  std::ios_base::failure is thrown.
+       *
+       *  If the error flag is already set when the exceptions mask is
+       *  added, the exception is immediately thrown.  Try running the
+       *  following under GCC 3.1 or later:
+       *  @code
+       *  #include <iostream>
+       *  #include <fstream>
+       *  #include <exception>
+       *
+       *  int main()
+       *  {
+       *      std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
+       *
+       *      std::ifstream f ("/etc/motd");
+       *
+       *      std::cerr << "Setting badbit\n";
+       *      f.setstate (std::ios_base::badbit);
+       *
+       *      std::cerr << "Setting exception mask\n";
+       *      f.exceptions (std::ios_base::badbit);
+       *  }
+       *  @endcode
+      */
+      void
+      exceptions(iostate __except)
+      {
+        _M_exception = __except;
+        this->clear(_M_streambuf_state);
+      }
+
+      // Constructor/destructor:
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  The parameter is passed by derived streams.
+      */
+      explicit
+      basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+      : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
+	_M_ctype(0), _M_num_put(0), _M_num_get(0)
+      { this->init(__sb); }
+
+      /**
+       *  @brief  Empty.
+       *
+       *  The destructor does nothing.  More specifically, it does not
+       *  destroy the streambuf held by rdbuf().
+      */
+      virtual
+      ~basic_ios() { }
+
+      // Members:
+      /**
+       *  @brief  Fetches the current @e tied stream.
+       *  @return  A pointer to the tied stream, or NULL if the stream is
+       *           not tied.
+       *
+       *  A stream may be @e tied (or synchronized) to a second output
+       *  stream.  When this stream performs any I/O, the tied stream is
+       *  first flushed.  For example, @c std::cin is tied to @c std::cout.
+      */
+      basic_ostream<_CharT, _Traits>*
+      tie() const
+      { return _M_tie; }
+
+      /**
+       *  @brief  Ties this stream to an output stream.
+       *  @param  __tiestr  The output stream.
+       *  @return  The previously tied output stream, or NULL if the stream
+       *           was not tied.
+       *
+       *  This sets up a new tie; see tie() for more.
+      */
+      basic_ostream<_CharT, _Traits>*
+      tie(basic_ostream<_CharT, _Traits>* __tiestr)
+      {
+        basic_ostream<_CharT, _Traits>* __old = _M_tie;
+        _M_tie = __tiestr;
+        return __old;
+      }
+
+      /**
+       *  @brief  Accessing the underlying buffer.
+       *  @return  The current stream buffer.
+       *
+       *  This does not change the state of the stream.
+      */
+      basic_streambuf<_CharT, _Traits>*
+      rdbuf() const
+      { return _M_streambuf; }
+
+      /**
+       *  @brief  Changing the underlying buffer.
+       *  @param  __sb  The new stream buffer.
+       *  @return  The previous stream buffer.
+       *
+       *  Associates a new buffer with the current stream, and clears the
+       *  error state.
+       *
+       *  Due to historical accidents which the LWG refuses to correct, the
+       *  I/O library suffers from a design error:  this function is hidden
+       *  in derived classes by overrides of the zero-argument @c rdbuf(),
+       *  which is non-virtual for hysterical raisins.  As a result, you
+       *  must use explicit qualifications to access this function via any
+       *  derived class.  For example:
+       *
+       *  @code
+       *  std::fstream     foo;         // or some other derived type
+       *  std::streambuf*  p = .....;
+       *
+       *  foo.ios::rdbuf(p);            // ios == basic_ios<char>
+       *  @endcode
+      */
+      basic_streambuf<_CharT, _Traits>*
+      rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
+
+      /**
+       *  @brief  Copies fields of __rhs into this.
+       *  @param  __rhs  The source values for the copies.
+       *  @return  Reference to this object.
+       *
+       *  All fields of __rhs are copied into this object except that rdbuf()
+       *  and rdstate() remain unchanged.  All values in the pword and iword
+       *  arrays are copied.  Before copying, each callback is invoked with
+       *  erase_event.  After copying, each (new) callback is invoked with
+       *  copyfmt_event.  The final step is to copy exceptions().
+      */
+      basic_ios&
+      copyfmt(const basic_ios& __rhs);
+
+      /**
+       *  @brief  Retrieves the @a empty character.
+       *  @return  The current fill character.
+       *
+       *  It defaults to a space (' ') in the current locale.
+      */
+      char_type
+      fill() const
+      {
+	if (!_M_fill_init)
+	  {
+	    _M_fill = this->widen(' ');
+	    _M_fill_init = true;
+	  }
+	return _M_fill;
+      }
+
+      /**
+       *  @brief  Sets a new @a empty character.
+       *  @param  __ch  The new character.
+       *  @return  The previous fill character.
+       *
+       *  The fill character is used to fill out space when P+ characters
+       *  have been requested (e.g., via setw), Q characters are actually
+       *  used, and Q<P.  It defaults to a space (' ') in the current locale.
+      */
+      char_type
+      fill(char_type __ch)
+      {
+	char_type __old = this->fill();
+	_M_fill = __ch;
+	return __old;
+      }
+
+      // Locales:
+      /**
+       *  @brief  Moves to a new locale.
+       *  @param  __loc  The new locale.
+       *  @return  The previous locale.
+       *
+       *  Calls @c ios_base::imbue(loc), and if a stream buffer is associated
+       *  with this stream, calls that buffer's @c pubimbue(loc).
+       *
+       *  Additional l10n notes are at
+       *  http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+      */
+      locale
+      imbue(const locale& __loc);
+
+      /**
+       *  @brief  Squeezes characters.
+       *  @param  __c  The character to narrow.
+       *  @param  __dfault  The character to narrow.
+       *  @return  The narrowed character.
+       *
+       *  Maps a character of @c char_type to a character of @c char,
+       *  if possible.
+       *
+       *  Returns the result of
+       *  @code
+       *    std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
+       *  @endcode
+       *
+       *  Additional l10n notes are at
+       *  http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+      */
+      char
+      narrow(char_type __c, char __dfault) const
+      { return __check_facet(_M_ctype).narrow(__c, __dfault); }
+
+      /**
+       *  @brief  Widens characters.
+       *  @param  __c  The character to widen.
+       *  @return  The widened character.
+       *
+       *  Maps a character of @c char to a character of @c char_type.
+       *
+       *  Returns the result of
+       *  @code
+       *    std::use_facet<ctype<char_type> >(getloc()).widen(c)
+       *  @endcode
+       *
+       *  Additional l10n notes are at
+       *  http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+      */
+      char_type
+      widen(char __c) const
+      { return __check_facet(_M_ctype).widen(__c); }
+
+    protected:
+      // 27.4.5.1  basic_ios constructors
+      /**
+       *  @brief  Empty.
+       *
+       *  The default constructor does nothing and is not normally
+       *  accessible to users.
+      */
+      basic_ios()
+      : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false), 
+	_M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
+      { }
+
+      /**
+       *  @brief  All setup is performed here.
+       *
+       *  This is called from the public constructor.  It is not virtual and
+       *  cannot be redefined.
+      */
+      void
+      init(basic_streambuf<_CharT, _Traits>* __sb);
+
+#if __cplusplus >= 201103L
+      basic_ios(const basic_ios&) = delete;
+      basic_ios& operator=(const basic_ios&) = delete;
+
+      void
+      move(basic_ios& __rhs)
+      {
+	ios_base::_M_move(__rhs);
+	_M_cache_locale(_M_ios_locale);
+	this->tie(__rhs.tie(nullptr));
+	_M_fill = __rhs._M_fill;
+	_M_fill_init = __rhs._M_fill_init;
+	_M_streambuf = nullptr;
+      }
+
+      void
+      move(basic_ios&& __rhs)
+      { this->move(__rhs); }
+
+      void
+      swap(basic_ios& __rhs) noexcept
+      {
+	ios_base::_M_swap(__rhs);
+	_M_cache_locale(_M_ios_locale);
+	__rhs._M_cache_locale(__rhs._M_ios_locale);
+	std::swap(_M_tie, __rhs._M_tie);
+	std::swap(_M_fill, __rhs._M_fill);
+	std::swap(_M_fill_init, __rhs._M_fill_init);
+      }
+
+      void
+      set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+      { _M_streambuf = __sb; }
+#endif
+
+      void
+      _M_cache_locale(const locale& __loc);
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#include <bits/basic_ios.tcc>
+
+#endif /* _BASIC_IOS_H */

+ 188 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_ios.tcc

@@ -0,0 +1,188 @@
+// basic_ios member functions -*- C++ -*-
+
+// Copyright (C) 1999-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/basic_ios.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ios}
+ */
+
+#ifndef _BASIC_IOS_TCC
+#define _BASIC_IOS_TCC 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::clear(iostate __state)
+    {
+      if (this->rdbuf())
+	_M_streambuf_state = __state;
+      else
+	  _M_streambuf_state = __state | badbit;
+      if (this->exceptions() & this->rdstate())
+	__throw_ios_failure(__N("basic_ios::clear"));
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_streambuf<_CharT, _Traits>*
+    basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+    {
+      basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
+      _M_streambuf = __sb;
+      this->clear();
+      return __old;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ios<_CharT, _Traits>&
+    basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 292. effects of a.copyfmt (a)
+      if (this != &__rhs)
+	{
+	  // Per 27.1.1, do not call imbue, yet must trash all caches
+	  // associated with imbue()
+
+	  // Alloc any new word array first, so if it fails we have "rollback".
+	  _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
+	                     _M_local_word : new _Words[__rhs._M_word_size];
+
+	  // Bump refs before doing callbacks, for safety.
+	  _Callback_list* __cb = __rhs._M_callbacks;
+	  if (__cb)
+	    __cb->_M_add_reference();
+	  _M_call_callbacks(erase_event);
+	  if (_M_word != _M_local_word)
+	    {
+	      delete [] _M_word;
+	      _M_word = 0;
+	    }
+	  _M_dispose_callbacks();
+
+	  // NB: Don't want any added during above.
+	  _M_callbacks = __cb;
+	  for (int __i = 0; __i < __rhs._M_word_size; ++__i)
+	    __words[__i] = __rhs._M_word[__i];
+	  _M_word = __words;
+	  _M_word_size = __rhs._M_word_size;
+
+	  this->flags(__rhs.flags());
+	  this->width(__rhs.width());
+	  this->precision(__rhs.precision());
+	  this->tie(__rhs.tie());
+	  this->fill(__rhs.fill());
+	  _M_ios_locale = __rhs.getloc();
+	  _M_cache_locale(_M_ios_locale);
+
+	  _M_call_callbacks(copyfmt_event);
+
+	  // The next is required to be the last assignment.
+	  this->exceptions(__rhs.exceptions());
+	}
+      return *this;
+    }
+
+  // Locales:
+  template<typename _CharT, typename _Traits>
+    locale
+    basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
+    {
+      locale __old(this->getloc());
+      ios_base::imbue(__loc);
+      _M_cache_locale(__loc);
+      if (this->rdbuf() != 0)
+	this->rdbuf()->pubimbue(__loc);
+      return __old;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
+    {
+      // NB: This may be called more than once on the same object.
+      ios_base::_M_init();
+
+      // Cache locale data and specific facets used by iostreams.
+      _M_cache_locale(_M_ios_locale);
+
+      // NB: The 27.4.4.1 Postconditions Table specifies requirements
+      // after basic_ios::init() has been called. As part of this,
+      // fill() must return widen(' ') any time after init() has been
+      // called, which needs an imbued ctype facet of char_type to
+      // return without throwing an exception. Unfortunately,
+      // ctype<char_type> is not necessarily a required facet, so
+      // streams with char_type != [char, wchar_t] will not have it by
+      // default. Because of this, the correct value for _M_fill is
+      // constructed on the first call of fill(). That way,
+      // unformatted input and output with non-required basic_ios
+      // instantiations is possible even without imbuing the expected
+      // ctype<char_type> facet.
+      _M_fill = _CharT();
+      _M_fill_init = false;
+
+      _M_tie = 0;
+      _M_exception = goodbit;
+      _M_streambuf = __sb;
+      _M_streambuf_state = __sb ? goodbit : badbit;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
+    {
+      if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
+	_M_ctype = std::__addressof(use_facet<__ctype_type>(__loc));
+      else
+	_M_ctype = 0;
+
+      if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+	_M_num_put = std::__addressof(use_facet<__num_put_type>(__loc));
+      else
+	_M_num_put = 0;
+
+      if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+	_M_num_get = std::__addressof(use_facet<__num_get_type>(__loc));
+      else
+	_M_num_get = 0;
+    }
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class basic_ios<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class basic_ios<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 6706 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_string.h

@@ -0,0 +1,6706 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/basic_string.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{string}
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _BASIC_STRING_H
+#define _BASIC_STRING_H 1
+
+#pragma GCC system_header
+
+#include <ext/atomicity.h>
+#include <ext/alloc_traits.h>
+#include <debug/debug.h>
+
+#if __cplusplus >= 201103L
+#include <initializer_list>
+#endif
+
+#if __cplusplus > 201402L
+# include <string_view>
+#endif
+
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#if _GLIBCXX_USE_CXX11_ABI
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+  /**
+   *  @class basic_string basic_string.h <string>
+   *  @brief  Managing sequences of characters and character-like objects.
+   *
+   *  @ingroup strings
+   *  @ingroup sequences
+   *
+   *  @tparam _CharT  Type of character
+   *  @tparam _Traits  Traits for character type, defaults to
+   *                   char_traits<_CharT>.
+   *  @tparam _Alloc  Allocator type, defaults to allocator<_CharT>.
+   *
+   *  Meets the requirements of a <a href="tables.html#65">container</a>, a
+   *  <a href="tables.html#66">reversible container</a>, and a
+   *  <a href="tables.html#67">sequence</a>.  Of the
+   *  <a href="tables.html#68">optional sequence requirements</a>, only
+   *  @c push_back, @c at, and @c %array access are supported.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    class basic_string
+    {
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+	rebind<_CharT>::other _Char_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Char_alloc_type> _Alloc_traits;
+
+      // Types:
+    public:
+      typedef _Traits					traits_type;
+      typedef typename _Traits::char_type		value_type;
+      typedef _Char_alloc_type				allocator_type;
+      typedef typename _Alloc_traits::size_type		size_type;
+      typedef typename _Alloc_traits::difference_type	difference_type;
+      typedef typename _Alloc_traits::reference		reference;
+      typedef typename _Alloc_traits::const_reference	const_reference;
+      typedef typename _Alloc_traits::pointer		pointer;
+      typedef typename _Alloc_traits::const_pointer	const_pointer;
+      typedef __gnu_cxx::__normal_iterator<pointer, basic_string>  iterator;
+      typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+							const_iterator;
+      typedef std::reverse_iterator<const_iterator>	const_reverse_iterator;
+      typedef std::reverse_iterator<iterator>		reverse_iterator;
+
+      ///  Value returned by various member functions when they fail.
+      static const size_type	npos = static_cast<size_type>(-1);
+
+    private:
+      // type used for positions in insert, erase etc.
+#if __cplusplus < 201103L
+      typedef iterator __const_iterator;
+#else
+      typedef const_iterator __const_iterator;
+#endif
+
+#if __cplusplus > 201402L
+      // A helper type for avoiding boiler-plate.
+      typedef basic_string_view<_CharT, _Traits> __sv_type;
+
+      template<typename _Tp, typename _Res>
+	using _If_sv = enable_if_t<
+	  __and_<is_convertible<const _Tp&, __sv_type>,
+		 __not_<is_convertible<const _Tp*, const basic_string*>>,
+		 __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
+	  _Res>;
+
+      // Allows an implicit conversion to __sv_type.
+      static __sv_type
+      _S_to_string_view(__sv_type __svt) noexcept
+      { return __svt; }
+
+      // Wraps a string_view by explicit conversion and thus
+      // allows to add an internal constructor that does not
+      // participate in overload resolution when a string_view
+      // is provided.
+      struct __sv_wrapper
+      {
+	explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
+	__sv_type _M_sv;
+      };
+#endif
+
+      // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
+      struct _Alloc_hider : allocator_type // TODO check __is_final
+      {
+#if __cplusplus < 201103L
+	_Alloc_hider(pointer __dat, const _Alloc& __a = _Alloc())
+	: allocator_type(__a), _M_p(__dat) { }
+#else
+	_Alloc_hider(pointer __dat, const _Alloc& __a)
+	: allocator_type(__a), _M_p(__dat) { }
+
+	_Alloc_hider(pointer __dat, _Alloc&& __a = _Alloc())
+	: allocator_type(std::move(__a)), _M_p(__dat) { }
+#endif
+
+	pointer _M_p; // The actual data.
+      };
+
+      _Alloc_hider	_M_dataplus;
+      size_type		_M_string_length;
+
+      enum { _S_local_capacity = 15 / sizeof(_CharT) };
+
+      union
+      {
+	_CharT           _M_local_buf[_S_local_capacity + 1];
+	size_type        _M_allocated_capacity;
+      };
+
+      void
+      _M_data(pointer __p)
+      { _M_dataplus._M_p = __p; }
+
+      void
+      _M_length(size_type __length)
+      { _M_string_length = __length; }
+
+      pointer
+      _M_data() const
+      { return _M_dataplus._M_p; }
+
+      pointer
+      _M_local_data()
+      {
+#if __cplusplus >= 201103L
+	return std::pointer_traits<pointer>::pointer_to(*_M_local_buf);
+#else
+	return pointer(_M_local_buf);
+#endif
+      }
+
+      const_pointer
+      _M_local_data() const
+      {
+#if __cplusplus >= 201103L
+	return std::pointer_traits<const_pointer>::pointer_to(*_M_local_buf);
+#else
+	return const_pointer(_M_local_buf);
+#endif
+      }
+
+      void
+      _M_capacity(size_type __capacity)
+      { _M_allocated_capacity = __capacity; }
+
+      void
+      _M_set_length(size_type __n)
+      {
+	_M_length(__n);
+	traits_type::assign(_M_data()[__n], _CharT());
+      }
+
+      bool
+      _M_is_local() const
+      { return _M_data() == _M_local_data(); }
+
+      // Create & Destroy
+      pointer
+      _M_create(size_type&, size_type);
+
+      void
+      _M_dispose()
+      {
+	if (!_M_is_local())
+	  _M_destroy(_M_allocated_capacity);
+      }
+
+      void
+      _M_destroy(size_type __size) throw()
+      { _Alloc_traits::deallocate(_M_get_allocator(), _M_data(), __size + 1); }
+
+      // _M_construct_aux is used to implement the 21.3.1 para 15 which
+      // requires special behaviour if _InIterator is an integral type
+      template<typename _InIterator>
+        void
+        _M_construct_aux(_InIterator __beg, _InIterator __end,
+			 std::__false_type)
+	{
+          typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+          _M_construct(__beg, __end, _Tag());
+	}
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
+      template<typename _Integer>
+        void
+        _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
+	{ _M_construct_aux_2(static_cast<size_type>(__beg), __end); }
+
+      void
+      _M_construct_aux_2(size_type __req, _CharT __c)
+      { _M_construct(__req, __c); }
+
+      template<typename _InIterator>
+        void
+        _M_construct(_InIterator __beg, _InIterator __end)
+	{
+	  typedef typename std::__is_integer<_InIterator>::__type _Integral;
+	  _M_construct_aux(__beg, __end, _Integral());
+        }
+
+      // For Input Iterators, used in istreambuf_iterators, etc.
+      template<typename _InIterator>
+        void
+        _M_construct(_InIterator __beg, _InIterator __end,
+		     std::input_iterator_tag);
+
+      // For forward_iterators up to random_access_iterators, used for
+      // string::iterator, _CharT*, etc.
+      template<typename _FwdIterator>
+        void
+        _M_construct(_FwdIterator __beg, _FwdIterator __end,
+		     std::forward_iterator_tag);
+
+      void
+      _M_construct(size_type __req, _CharT __c);
+
+      allocator_type&
+      _M_get_allocator()
+      { return _M_dataplus; }
+
+      const allocator_type&
+      _M_get_allocator() const
+      { return _M_dataplus; }
+
+    private:
+
+#ifdef _GLIBCXX_DISAMBIGUATE_REPLACE_INST
+      // The explicit instantiations in misc-inst.cc require this due to
+      // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64063
+      template<typename _Tp, bool _Requires =
+	       !__are_same<_Tp, _CharT*>::__value
+	       && !__are_same<_Tp, const _CharT*>::__value
+	       && !__are_same<_Tp, iterator>::__value
+	       && !__are_same<_Tp, const_iterator>::__value>
+	struct __enable_if_not_native_iterator
+	{ typedef basic_string& __type; };
+      template<typename _Tp>
+	struct __enable_if_not_native_iterator<_Tp, false> { };
+#endif
+
+      size_type
+      _M_check(size_type __pos, const char* __s) const
+      {
+	if (__pos > this->size())
+	  __throw_out_of_range_fmt(__N("%s: __pos (which is %zu) > "
+				       "this->size() (which is %zu)"),
+				   __s, __pos, this->size());
+	return __pos;
+      }
+
+      void
+      _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+      {
+	if (this->max_size() - (this->size() - __n1) < __n2)
+	  __throw_length_error(__N(__s));
+      }
+
+
+      // NB: _M_limit doesn't check for a bad __pos value.
+      size_type
+      _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
+      {
+	const bool __testoff =  __off < this->size() - __pos;
+	return __testoff ? __off : this->size() - __pos;
+      }
+
+      // True if _Rep and source do not overlap.
+      bool
+      _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT
+      {
+	return (less<const _CharT*>()(__s, _M_data())
+		|| less<const _CharT*>()(_M_data() + this->size(), __s));
+      }
+
+      // When __n = 1 way faster than the general multichar
+      // traits_type::copy/move/assign.
+      static void
+      _S_copy(_CharT* __d, const _CharT* __s, size_type __n)
+      {
+	if (__n == 1)
+	  traits_type::assign(*__d, *__s);
+	else
+	  traits_type::copy(__d, __s, __n);
+      }
+
+      static void
+      _S_move(_CharT* __d, const _CharT* __s, size_type __n)
+      {
+	if (__n == 1)
+	  traits_type::assign(*__d, *__s);
+	else
+	  traits_type::move(__d, __s, __n);
+      }
+
+      static void
+      _S_assign(_CharT* __d, size_type __n, _CharT __c)
+      {
+	if (__n == 1)
+	  traits_type::assign(*__d, __c);
+	else
+	  traits_type::assign(__d, __n, __c);
+      }
+
+      // _S_copy_chars is a separate template to permit specialization
+      // to optimize for the common case of pointers as iterators.
+      template<class _Iterator>
+        static void
+        _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+        {
+	  for (; __k1 != __k2; ++__k1, (void)++__p)
+	    traits_type::assign(*__p, *__k1); // These types are off.
+	}
+
+      static void
+      _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+      _GLIBCXX_NOEXCEPT
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
+      { _S_copy(__p, __k1, __k2 - __k1); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+      _GLIBCXX_NOEXCEPT
+      { _S_copy(__p, __k1, __k2 - __k1); }
+
+      static int
+      _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT
+      {
+	const difference_type __d = difference_type(__n1 - __n2);
+
+	if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+	  return __gnu_cxx::__numeric_traits<int>::__max;
+	else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+	  return __gnu_cxx::__numeric_traits<int>::__min;
+	else
+	  return int(__d);
+      }
+
+      void
+      _M_assign(const basic_string&);
+
+      void
+      _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+		size_type __len2);
+
+      void
+      _M_erase(size_type __pos, size_type __n);
+
+    public:
+      // Construct/copy/destroy:
+      // NB: We overload ctors in some cases instead of using default
+      // arguments, per 17.4.4.4 para. 2 item 2.
+
+      /**
+       *  @brief  Default constructor creates an empty string.
+       */
+      basic_string()
+      _GLIBCXX_NOEXCEPT_IF(is_nothrow_default_constructible<_Alloc>::value)
+      : _M_dataplus(_M_local_data())
+      { _M_set_length(0); }
+
+      /**
+       *  @brief  Construct an empty string using allocator @a a.
+       */
+      explicit
+      basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_set_length(0); }
+
+      /**
+       *  @brief  Construct string with copy of value of @a __str.
+       *  @param  __str  Source string.
+       */
+      basic_string(const basic_string& __str)
+      : _M_dataplus(_M_local_data(),
+		    _Alloc_traits::_S_select_on_copy(__str._M_get_allocator()))
+      { _M_construct(__str._M_data(), __str._M_data() + __str.length()); }
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2583. no way to supply an allocator for basic_string(str, pos)
+      /**
+       *  @brief  Construct string as copy of a substring.
+       *  @param  __str  Source string.
+       *  @param  __pos  Index of first character to copy from.
+       *  @param  __a  Allocator to use.
+       */
+      basic_string(const basic_string& __str, size_type __pos,
+		   const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      {
+	const _CharT* __start = __str._M_data()
+	  + __str._M_check(__pos, "basic_string::basic_string");
+	_M_construct(__start, __start + __str._M_limit(__pos, npos));
+      }
+
+      /**
+       *  @brief  Construct string as copy of a substring.
+       *  @param  __str  Source string.
+       *  @param  __pos  Index of first character to copy from.
+       *  @param  __n  Number of characters to copy.
+       */
+      basic_string(const basic_string& __str, size_type __pos,
+		   size_type __n)
+      : _M_dataplus(_M_local_data())
+      {
+	const _CharT* __start = __str._M_data()
+	  + __str._M_check(__pos, "basic_string::basic_string");
+	_M_construct(__start, __start + __str._M_limit(__pos, __n));
+      }
+
+      /**
+       *  @brief  Construct string as copy of a substring.
+       *  @param  __str  Source string.
+       *  @param  __pos  Index of first character to copy from.
+       *  @param  __n  Number of characters to copy.
+       *  @param  __a  Allocator to use.
+       */
+      basic_string(const basic_string& __str, size_type __pos,
+		   size_type __n, const _Alloc& __a)
+      : _M_dataplus(_M_local_data(), __a)
+      {
+	const _CharT* __start
+	  = __str._M_data() + __str._M_check(__pos, "string::string");
+	_M_construct(__start, __start + __str._M_limit(__pos, __n));
+      }
+
+      /**
+       *  @brief  Construct string initialized by a character %array.
+       *  @param  __s  Source character %array.
+       *  @param  __n  Number of characters to copy.
+       *  @param  __a  Allocator to use (default is default allocator).
+       *
+       *  NB: @a __s must have at least @a __n characters, &apos;\\0&apos;
+       *  has no special meaning.
+       */
+      basic_string(const _CharT* __s, size_type __n,
+		   const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__s, __s + __n); }
+
+      /**
+       *  @brief  Construct string as copy of a C string.
+       *  @param  __s  Source C string.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__s, __s ? __s + traits_type::length(__s) : __s+npos); }
+
+      /**
+       *  @brief  Construct string as multiple characters.
+       *  @param  __n  Number of characters.
+       *  @param  __c  Character to use.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__n, __c); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Move construct string.
+       *  @param  __str  Source string.
+       *
+       *  The newly-created string contains the exact contents of @a __str.
+       *  @a __str is a valid, but unspecified string.
+       **/
+      basic_string(basic_string&& __str) noexcept
+      : _M_dataplus(_M_local_data(), std::move(__str._M_get_allocator()))
+      {
+	if (__str._M_is_local())
+	  {
+	    traits_type::copy(_M_local_buf, __str._M_local_buf,
+			      _S_local_capacity + 1);
+	  }
+	else
+	  {
+	    _M_data(__str._M_data());
+	    _M_capacity(__str._M_allocated_capacity);
+	  }
+
+	// Must use _M_length() here not _M_set_length() because
+	// basic_stringbuf relies on writing into unallocated capacity so
+	// we mess up the contents if we put a '\0' in the string.
+	_M_length(__str.length());
+	__str._M_data(__str._M_local_data());
+	__str._M_set_length(0);
+      }
+
+      /**
+       *  @brief  Construct string from an initializer %list.
+       *  @param  __l  std::initializer_list of characters.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__l.begin(), __l.end()); }
+
+      basic_string(const basic_string& __str, const _Alloc& __a)
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__str.begin(), __str.end()); }
+
+      basic_string(basic_string&& __str, const _Alloc& __a)
+      noexcept(_Alloc_traits::_S_always_equal())
+      : _M_dataplus(_M_local_data(), __a)
+      {
+	if (__str._M_is_local())
+	  {
+	    traits_type::copy(_M_local_buf, __str._M_local_buf,
+			      _S_local_capacity + 1);
+	    _M_length(__str.length());
+	    __str._M_set_length(0);
+	  }
+	else if (_Alloc_traits::_S_always_equal()
+	    || __str.get_allocator() == __a)
+	  {
+	    _M_data(__str._M_data());
+	    _M_length(__str.length());
+	    _M_capacity(__str._M_allocated_capacity);
+	    __str._M_data(__str._M_local_buf);
+	    __str._M_set_length(0);
+	  }
+	else
+	  _M_construct(__str.begin(), __str.end());
+      }
+
+#endif // C++11
+
+      /**
+       *  @brief  Construct string as copy of a range.
+       *  @param  __beg  Start of range.
+       *  @param  __end  End of range.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+#if __cplusplus >= 201103L
+      template<typename _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+#else
+      template<typename _InputIterator>
+#endif
+        basic_string(_InputIterator __beg, _InputIterator __end,
+		     const _Alloc& __a = _Alloc())
+	: _M_dataplus(_M_local_data(), __a)
+	{ _M_construct(__beg, __end); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Construct string from a substring of a string_view.
+       *  @param  __t   Source object convertible to string view.
+       *  @param  __pos The index of the first character to copy from __t.
+       *  @param  __n   The number of characters to copy from __t.
+       *  @param  __a   Allocator to use.
+       */
+      template<typename _Tp, typename = _If_sv<_Tp, void>>
+	basic_string(const _Tp& __t, size_type __pos, size_type __n,
+		     const _Alloc& __a = _Alloc())
+	: basic_string(_S_to_string_view(__t).substr(__pos, __n), __a) { }
+
+      /**
+       *  @brief  Construct string from a string_view.
+       *  @param  __t  Source object convertible to string view.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      template<typename _Tp, typename = _If_sv<_Tp, void>>
+	explicit
+	basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
+	: basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
+
+      /**
+       *  @brief  Only internally used: Construct string from a string view
+       *          wrapper.
+       *  @param  __svw  string view wrapper.
+       *  @param  __a  Allocator to use.
+       */
+      explicit
+      basic_string(__sv_wrapper __svw, const _Alloc& __a)
+      : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { }
+#endif // C++17
+
+      /**
+       *  @brief  Destroy the string instance.
+       */
+      ~basic_string()
+      { _M_dispose(); }
+
+      /**
+       *  @brief  Assign the value of @a str to this string.
+       *  @param  __str  Source string.
+       */
+      basic_string&
+      operator=(const basic_string& __str)
+      {
+#if __cplusplus >= 201103L
+	if (_Alloc_traits::_S_propagate_on_copy_assign())
+	  {
+	    if (!_Alloc_traits::_S_always_equal() && !_M_is_local()
+		&& _M_get_allocator() != __str._M_get_allocator())
+	      {
+		// Propagating allocator cannot free existing storage so must
+		// deallocate it before replacing current allocator.
+		if (__str.size() <= _S_local_capacity)
+		  {
+		    _M_destroy(_M_allocated_capacity);
+		    _M_data(_M_local_data());
+		    _M_set_length(0);
+		  }
+		else
+		  {
+		    const auto __len = __str.size();
+		    auto __alloc = __str._M_get_allocator();
+		    // If this allocation throws there are no effects:
+		    auto __ptr = _Alloc_traits::allocate(__alloc, __len + 1);
+		    _M_destroy(_M_allocated_capacity);
+		    _M_data(__ptr);
+		    _M_capacity(__len);
+		    _M_set_length(__len);
+		  }
+	      }
+	    std::__alloc_on_copy(_M_get_allocator(), __str._M_get_allocator());
+	  }
+#endif
+	return this->assign(__str);
+      }
+
+      /**
+       *  @brief  Copy contents of @a s into this string.
+       *  @param  __s  Source null-terminated string.
+       */
+      basic_string&
+      operator=(const _CharT* __s)
+      { return this->assign(__s); }
+
+      /**
+       *  @brief  Set value to string of length 1.
+       *  @param  __c  Source character.
+       *
+       *  Assigning to a character makes this string length 1 and
+       *  (*this)[0] == @a c.
+       */
+      basic_string&
+      operator=(_CharT __c)
+      {
+	this->assign(1, __c);
+	return *this;
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Move assign the value of @a str to this string.
+       *  @param  __str  Source string.
+       *
+       *  The contents of @a str are moved into this string (without copying).
+       *  @a str is a valid, but unspecified string.
+       **/
+      // PR 58265, this should be noexcept.
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2063. Contradictory requirements for string move assignment
+      basic_string&
+      operator=(basic_string&& __str)
+      noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+	if (!_M_is_local() && _Alloc_traits::_S_propagate_on_move_assign()
+	    && !_Alloc_traits::_S_always_equal()
+	    && _M_get_allocator() != __str._M_get_allocator())
+	  {
+	    // Destroy existing storage before replacing allocator.
+	    _M_destroy(_M_allocated_capacity);
+	    _M_data(_M_local_data());
+	    _M_set_length(0);
+	  }
+	// Replace allocator if POCMA is true.
+	std::__alloc_on_move(_M_get_allocator(), __str._M_get_allocator());
+
+	if (__str._M_is_local())
+	  {
+	    // We've always got room for a short string, just copy it.
+	    if (__str.size())
+	      this->_S_copy(_M_data(), __str._M_data(), __str.size());
+	    _M_set_length(__str.size());
+	  }
+	else if (_Alloc_traits::_S_propagate_on_move_assign()
+	    || _Alloc_traits::_S_always_equal()
+	    || _M_get_allocator() == __str._M_get_allocator())
+	  {
+	    // Just move the allocated pointer, our allocator can free it.
+	    pointer __data = nullptr;
+	    size_type __capacity;
+	    if (!_M_is_local())
+	      {
+		if (_Alloc_traits::_S_always_equal())
+		  {
+		    // __str can reuse our existing storage.
+		    __data = _M_data();
+		    __capacity = _M_allocated_capacity;
+		  }
+		else // __str can't use it, so free it.
+		  _M_destroy(_M_allocated_capacity);
+	      }
+
+	    _M_data(__str._M_data());
+	    _M_length(__str.length());
+	    _M_capacity(__str._M_allocated_capacity);
+	    if (__data)
+	      {
+		__str._M_data(__data);
+		__str._M_capacity(__capacity);
+	      }
+	    else
+	      __str._M_data(__str._M_local_buf);
+	  }
+	else // Need to do a deep copy
+	  assign(__str);
+	__str.clear();
+	return *this;
+      }
+
+      /**
+       *  @brief  Set value to string constructed from initializer %list.
+       *  @param  __l  std::initializer_list.
+       */
+      basic_string&
+      operator=(initializer_list<_CharT> __l)
+      {
+	this->assign(__l.begin(), __l.size());
+	return *this;
+      }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Set value to string constructed from a string_view.
+       *  @param  __svt  An object convertible to string_view.
+       */
+     template<typename _Tp>
+       _If_sv<_Tp, basic_string&>
+       operator=(const _Tp& __svt)
+       { return this->assign(__svt); }
+
+      /**
+       *  @brief  Convert to a string_view.
+       *  @return A string_view.
+       */
+      operator __sv_type() const noexcept
+      { return __sv_type(data(), size()); }
+#endif // C++17
+
+      // Iterators:
+      /**
+       *  Returns a read/write iterator that points to the first character in
+       *  the %string.
+       */
+      iterator
+      begin() _GLIBCXX_NOEXCEPT
+      { return iterator(_M_data()); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points to the first
+       *  character in the %string.
+       */
+      const_iterator
+      begin() const _GLIBCXX_NOEXCEPT
+      { return const_iterator(_M_data()); }
+
+      /**
+       *  Returns a read/write iterator that points one past the last
+       *  character in the %string.
+       */
+      iterator
+      end() _GLIBCXX_NOEXCEPT
+      { return iterator(_M_data() + this->size()); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points one past the
+       *  last character in the %string.
+       */
+      const_iterator
+      end() const _GLIBCXX_NOEXCEPT
+      { return const_iterator(_M_data() + this->size()); }
+
+      /**
+       *  Returns a read/write reverse iterator that points to the last
+       *  character in the %string.  Iteration is done in reverse element
+       *  order.
+       */
+      reverse_iterator
+      rbegin() _GLIBCXX_NOEXCEPT
+      { return reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to the last character in the %string.  Iteration is done in
+       *  reverse element order.
+       */
+      const_reverse_iterator
+      rbegin() const _GLIBCXX_NOEXCEPT
+      { return const_reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read/write reverse iterator that points to one before the
+       *  first character in the %string.  Iteration is done in reverse
+       *  element order.
+       */
+      reverse_iterator
+      rend() _GLIBCXX_NOEXCEPT
+      { return reverse_iterator(this->begin()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to one before the first character in the %string.  Iteration
+       *  is done in reverse element order.
+       */
+      const_reverse_iterator
+      rend() const _GLIBCXX_NOEXCEPT
+      { return const_reverse_iterator(this->begin()); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  Returns a read-only (constant) iterator that points to the first
+       *  character in the %string.
+       */
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_data()); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points one past the
+       *  last character in the %string.
+       */
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(this->_M_data() + this->size()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to the last character in the %string.  Iteration is done in
+       *  reverse element order.
+       */
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to one before the first character in the %string.  Iteration
+       *  is done in reverse element order.
+       */
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(this->begin()); }
+#endif
+
+    public:
+      // Capacity:
+      ///  Returns the number of characters in the string, not including any
+      ///  null-termination.
+      size_type
+      size() const _GLIBCXX_NOEXCEPT
+      { return _M_string_length; }
+
+      ///  Returns the number of characters in the string, not including any
+      ///  null-termination.
+      size_type
+      length() const _GLIBCXX_NOEXCEPT
+      { return _M_string_length; }
+
+      ///  Returns the size() of the largest possible %string.
+      size_type
+      max_size() const _GLIBCXX_NOEXCEPT
+      { return (_Alloc_traits::max_size(_M_get_allocator()) - 1) / 2; }
+
+      /**
+       *  @brief  Resizes the %string to the specified number of characters.
+       *  @param  __n  Number of characters the %string should contain.
+       *  @param  __c  Character to fill any new elements.
+       *
+       *  This function will %resize the %string to the specified
+       *  number of characters.  If the number is smaller than the
+       *  %string's current size the %string is truncated, otherwise
+       *  the %string is extended and new elements are %set to @a __c.
+       */
+      void
+      resize(size_type __n, _CharT __c);
+
+      /**
+       *  @brief  Resizes the %string to the specified number of characters.
+       *  @param  __n  Number of characters the %string should contain.
+       *
+       *  This function will resize the %string to the specified length.  If
+       *  the new size is smaller than the %string's current size the %string
+       *  is truncated, otherwise the %string is extended and new characters
+       *  are default-constructed.  For basic types such as char, this means
+       *  setting them to 0.
+       */
+      void
+      resize(size_type __n)
+      { this->resize(__n, _CharT()); }
+
+#if __cplusplus >= 201103L
+      ///  A non-binding request to reduce capacity() to size().
+      void
+      shrink_to_fit() noexcept
+      {
+#if __cpp_exceptions
+	if (capacity() > size())
+	  {
+	    try
+	      { reserve(0); }
+	    catch(...)
+	      { }
+	  }
+#endif
+      }
+#endif
+
+      /**
+       *  Returns the total number of characters that the %string can hold
+       *  before needing to allocate more memory.
+       */
+      size_type
+      capacity() const _GLIBCXX_NOEXCEPT
+      {
+	return _M_is_local() ? size_type(_S_local_capacity)
+	                     : _M_allocated_capacity;
+      }
+
+      /**
+       *  @brief  Attempt to preallocate enough memory for specified number of
+       *          characters.
+       *  @param  __res_arg  Number of characters required.
+       *  @throw  std::length_error  If @a __res_arg exceeds @c max_size().
+       *
+       *  This function attempts to reserve enough memory for the
+       *  %string to hold the specified number of characters.  If the
+       *  number requested is more than max_size(), length_error is
+       *  thrown.
+       *
+       *  The advantage of this function is that if optimal code is a
+       *  necessity and the user can determine the string length that will be
+       *  required, the user can reserve the memory in %advance, and thus
+       *  prevent a possible reallocation of memory and copying of %string
+       *  data.
+       */
+      void
+      reserve(size_type __res_arg = 0);
+
+      /**
+       *  Erases the string, making it empty.
+       */
+      void
+      clear() _GLIBCXX_NOEXCEPT
+      { _M_set_length(0); }
+
+      /**
+       *  Returns true if the %string is empty.  Equivalent to 
+       *  <code>*this == ""</code>.
+       */
+      bool
+      empty() const _GLIBCXX_NOEXCEPT
+      { return this->size() == 0; }
+
+      // Element access:
+      /**
+       *  @brief  Subscript access to the data contained in the %string.
+       *  @param  __pos  The index of the character to access.
+       *  @return  Read-only (constant) reference to the character.
+       *
+       *  This operator allows for easy, array-style, data access.
+       *  Note that data access with this operator is unchecked and
+       *  out_of_range lookups are not defined. (For checked lookups
+       *  see at().)
+       */
+      const_reference
+      operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_assert(__pos <= size());
+	return _M_data()[__pos];
+      }
+
+      /**
+       *  @brief  Subscript access to the data contained in the %string.
+       *  @param  __pos  The index of the character to access.
+       *  @return  Read/write reference to the character.
+       *
+       *  This operator allows for easy, array-style, data access.
+       *  Note that data access with this operator is unchecked and
+       *  out_of_range lookups are not defined. (For checked lookups
+       *  see at().)
+       */
+      reference
+      operator[](size_type __pos)
+      {
+        // Allow pos == size() both in C++98 mode, as v3 extension,
+	// and in C++11 mode.
+	__glibcxx_assert(__pos <= size());
+        // In pedantic mode be strict in C++98 mode.
+	_GLIBCXX_DEBUG_PEDASSERT(__cplusplus >= 201103L || __pos < size());
+	return _M_data()[__pos];
+      }
+
+      /**
+       *  @brief  Provides access to the data contained in the %string.
+       *  @param __n The index of the character to access.
+       *  @return  Read-only (const) reference to the character.
+       *  @throw  std::out_of_range  If @a n is an invalid index.
+       *
+       *  This function provides for safer data access.  The parameter is
+       *  first checked that it is in the range of the string.  The function
+       *  throws out_of_range if the check fails.
+       */
+      const_reference
+      at(size_type __n) const
+      {
+	if (__n >= this->size())
+	  __throw_out_of_range_fmt(__N("basic_string::at: __n "
+				       "(which is %zu) >= this->size() "
+				       "(which is %zu)"),
+				   __n, this->size());
+	return _M_data()[__n];
+      }
+
+      /**
+       *  @brief  Provides access to the data contained in the %string.
+       *  @param __n The index of the character to access.
+       *  @return  Read/write reference to the character.
+       *  @throw  std::out_of_range  If @a n is an invalid index.
+       *
+       *  This function provides for safer data access.  The parameter is
+       *  first checked that it is in the range of the string.  The function
+       *  throws out_of_range if the check fails.
+       */
+      reference
+      at(size_type __n)
+      {
+	if (__n >= size())
+	  __throw_out_of_range_fmt(__N("basic_string::at: __n "
+				       "(which is %zu) >= this->size() "
+				       "(which is %zu)"),
+				   __n, this->size());
+	return _M_data()[__n];
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  Returns a read/write reference to the data at the first
+       *  element of the %string.
+       */
+      reference
+      front() noexcept
+      {
+	__glibcxx_assert(!empty());
+	return operator[](0);
+      }
+
+      /**
+       *  Returns a read-only (constant) reference to the data at the first
+       *  element of the %string.
+       */
+      const_reference
+      front() const noexcept
+      {
+	__glibcxx_assert(!empty());
+	return operator[](0);
+      }
+
+      /**
+       *  Returns a read/write reference to the data at the last
+       *  element of the %string.
+       */
+      reference
+      back() noexcept
+      {
+	__glibcxx_assert(!empty());
+	return operator[](this->size() - 1);
+      }
+
+      /**
+       *  Returns a read-only (constant) reference to the data at the
+       *  last element of the %string.
+       */
+      const_reference
+      back() const noexcept
+      {
+	__glibcxx_assert(!empty());
+	return operator[](this->size() - 1);
+      }
+#endif
+
+      // Modifiers:
+      /**
+       *  @brief  Append a string to this string.
+       *  @param __str  The string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(const basic_string& __str)
+      { return this->append(__str); }
+
+      /**
+       *  @brief  Append a C string.
+       *  @param __s  The C string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(const _CharT* __s)
+      { return this->append(__s); }
+
+      /**
+       *  @brief  Append a character.
+       *  @param __c  The character to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(_CharT __c)
+      {
+	this->push_back(__c);
+	return *this;
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Append an initializer_list of characters.
+       *  @param __l  The initializer_list of characters to be appended.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Append a string_view.
+       *  @param __svt  An object convertible to string_view to be appended.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	operator+=(const _Tp& __svt)
+	{ return this->append(__svt); }
+#endif // C++17
+
+      /**
+       *  @brief  Append a string to this string.
+       *  @param __str  The string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(const basic_string& __str)
+      { return _M_append(__str._M_data(), __str.size()); }
+
+      /**
+       *  @brief  Append a substring.
+       *  @param __str  The string to append.
+       *  @param __pos  Index of the first character of str to append.
+       *  @param __n  The number of characters to append.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range if @a __pos is not a valid index.
+       *
+       *  This function appends @a __n characters from @a __str
+       *  starting at @a __pos to this string.  If @a __n is is larger
+       *  than the number of available characters in @a __str, the
+       *  remainder of @a __str is appended.
+       */
+      basic_string&
+      append(const basic_string& __str, size_type __pos, size_type __n = npos)
+      { return _M_append(__str._M_data()
+			 + __str._M_check(__pos, "basic_string::append"),
+			 __str._M_limit(__pos, __n)); }
+
+      /**
+       *  @brief  Append a C substring.
+       *  @param __s  The C string to append.
+       *  @param __n  The number of characters to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(const _CharT* __s, size_type __n)
+      {
+	__glibcxx_requires_string_len(__s, __n);
+	_M_check_length(size_type(0), __n, "basic_string::append");
+	return _M_append(__s, __n);
+      }
+
+      /**
+       *  @brief  Append a C string.
+       *  @param __s  The C string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	const size_type __n = traits_type::length(__s);
+	_M_check_length(size_type(0), __n, "basic_string::append");
+	return _M_append(__s, __n);
+      }
+
+      /**
+       *  @brief  Append multiple characters.
+       *  @param __n  The number of characters to append.
+       *  @param __c  The character to use.
+       *  @return  Reference to this string.
+       *
+       *  Appends __n copies of __c to this string.
+       */
+      basic_string&
+      append(size_type __n, _CharT __c)
+      { return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Append an initializer_list of characters.
+       *  @param __l  The initializer_list of characters to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+#endif // C++11
+
+      /**
+       *  @brief  Append a range of characters.
+       *  @param __first  Iterator referencing the first character to append.
+       *  @param __last  Iterator marking the end of the range.
+       *  @return  Reference to this string.
+       *
+       *  Appends characters in the range [__first,__last) to this string.
+       */
+#if __cplusplus >= 201103L
+      template<class _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+#else
+      template<class _InputIterator>
+#endif
+        basic_string&
+        append(_InputIterator __first, _InputIterator __last)
+        { return this->replace(end(), end(), __first, __last); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Append a string_view.
+       *  @param __svt  An object convertible to string_view to be appended.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+        _If_sv<_Tp, basic_string&>
+        append(const _Tp& __svt)
+        {
+          __sv_type __sv = __svt;
+          return this->append(__sv.data(), __sv.size());
+        }
+
+      /**
+       *  @brief  Append a range of characters from a string_view.
+       *  @param __svt  An object convertible to string_view to be appended from.
+       *  @param __pos The position in the string_view to append from.
+       *  @param __n   The number of characters to append from the string_view.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+        _If_sv<_Tp, basic_string&>
+	append(const _Tp& __svt, size_type __pos, size_type __n = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return _M_append(__sv.data()
+			   + __sv._M_check(__pos, "basic_string::append"),
+			   __sv._M_limit(__pos, __n));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Append a single character.
+       *  @param __c  Character to append.
+       */
+      void
+      push_back(_CharT __c)
+      {
+	const size_type __size = this->size();
+	if (__size + 1 > this->capacity())
+	  this->_M_mutate(__size, size_type(0), 0, size_type(1));
+	traits_type::assign(this->_M_data()[__size], __c);
+	this->_M_set_length(__size + 1);
+      }
+
+      /**
+       *  @brief  Set value to contents of another string.
+       *  @param  __str  Source string to use.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      assign(const basic_string& __str)
+      {
+	this->_M_assign(__str);
+	return *this;
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Set value to contents of another string.
+       *  @param  __str  Source string to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets this string to the exact contents of @a __str.
+       *  @a __str is a valid, but unspecified string.
+       */
+      basic_string&
+      assign(basic_string&& __str)
+      noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
+	// 2063. Contradictory requirements for string move assignment
+	return *this = std::move(__str);
+      }
+#endif // C++11
+
+      /**
+       *  @brief  Set value to a substring of a string.
+       *  @param __str  The string to use.
+       *  @param __pos  Index of the first character of str.
+       *  @param __n  Number of characters to use.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range if @a pos is not a valid index.
+       *
+       *  This function sets this string to the substring of @a __str
+       *  consisting of @a __n characters at @a __pos.  If @a __n is
+       *  is larger than the number of available characters in @a
+       *  __str, the remainder of @a __str is used.
+       */
+      basic_string&
+      assign(const basic_string& __str, size_type __pos, size_type __n = npos)
+      { return _M_replace(size_type(0), this->size(), __str._M_data()
+			  + __str._M_check(__pos, "basic_string::assign"),
+			  __str._M_limit(__pos, __n)); }
+
+      /**
+       *  @brief  Set value to a C substring.
+       *  @param __s  The C string to use.
+       *  @param __n  Number of characters to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets the value of this string to the first @a __n
+       *  characters of @a __s.  If @a __n is is larger than the number of
+       *  available characters in @a __s, the remainder of @a __s is used.
+       */
+      basic_string&
+      assign(const _CharT* __s, size_type __n)
+      {
+	__glibcxx_requires_string_len(__s, __n);
+	return _M_replace(size_type(0), this->size(), __s, __n);
+      }
+
+      /**
+       *  @brief  Set value to contents of a C string.
+       *  @param __s  The C string to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets the value of this string to the value of @a __s.
+       *  The data is copied, so there is no dependence on @a __s once the
+       *  function returns.
+       */
+      basic_string&
+      assign(const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return _M_replace(size_type(0), this->size(), __s,
+			  traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Set value to multiple characters.
+       *  @param __n  Length of the resulting string.
+       *  @param __c  The character to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets the value of this string to @a __n copies of
+       *  character @a __c.
+       */
+      basic_string&
+      assign(size_type __n, _CharT __c)
+      { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+
+      /**
+       *  @brief  Set value to a range of characters.
+       *  @param __first  Iterator referencing the first character to append.
+       *  @param __last  Iterator marking the end of the range.
+       *  @return  Reference to this string.
+       *
+       *  Sets value of string to characters in the range [__first,__last).
+      */
+#if __cplusplus >= 201103L
+      template<class _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+#else
+      template<class _InputIterator>
+#endif
+        basic_string&
+        assign(_InputIterator __first, _InputIterator __last)
+        { return this->replace(begin(), end(), __first, __last); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Set value to an initializer_list of characters.
+       *  @param __l  The initializer_list of characters to assign.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      assign(initializer_list<_CharT> __l)
+      { return this->assign(__l.begin(), __l.size()); }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Set value from a string_view.
+       *  @param __svt  The source object convertible to string_view.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	assign(const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->assign(__sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Set value from a range of characters in a string_view.
+       *  @param __svt  The source object convertible to string_view.
+       *  @param __pos  The position in the string_view to assign from.
+       *  @param __n  The number of characters to assign.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	assign(const _Tp& __svt, size_type __pos, size_type __n = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return _M_replace(size_type(0), this->size(), __sv.data()
+			    + __sv._M_check(__pos, "basic_string::assign"),
+			    __sv._M_limit(__pos, __n));
+	}
+#endif // C++17
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Insert multiple characters.
+       *  @param __p  Const_iterator referencing location in string to
+       *              insert at.
+       *  @param __n  Number of characters to insert
+       *  @param __c  The character to insert.
+       *  @return  Iterator referencing the first inserted char.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts @a __n copies of character @a __c starting at the
+       *  position referenced by iterator @a __p.  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      iterator
+      insert(const_iterator __p, size_type __n, _CharT __c)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end());
+	const size_type __pos = __p - begin();
+	this->replace(__p, __p, __n, __c);
+	return iterator(this->_M_data() + __pos);
+      }
+#else
+      /**
+       *  @brief  Insert multiple characters.
+       *  @param __p  Iterator referencing location in string to insert at.
+       *  @param __n  Number of characters to insert
+       *  @param __c  The character to insert.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts @a __n copies of character @a __c starting at the
+       *  position referenced by iterator @a __p.  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      void
+      insert(iterator __p, size_type __n, _CharT __c)
+      {	this->replace(__p, __p, __n, __c);  }
+#endif
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Insert a range of characters.
+       *  @param __p  Const_iterator referencing location in string to
+       *              insert at.
+       *  @param __beg  Start of range.
+       *  @param __end  End of range.
+       *  @return  Iterator referencing the first inserted char.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts characters in range [beg,end).  If adding characters
+       *  causes the length to exceed max_size(), length_error is
+       *  thrown.  The value of the string doesn't change if an error
+       *  is thrown.
+      */
+      template<class _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+	iterator
+        insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
+        {
+	  _GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end());
+	  const size_type __pos = __p - begin();
+	  this->replace(__p, __p, __beg, __end);
+	  return iterator(this->_M_data() + __pos);
+	}
+#else
+      /**
+       *  @brief  Insert a range of characters.
+       *  @param __p  Iterator referencing location in string to insert at.
+       *  @param __beg  Start of range.
+       *  @param __end  End of range.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts characters in range [__beg,__end).  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      template<class _InputIterator>
+        void
+        insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+        { this->replace(__p, __p, __beg, __end); }
+#endif
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Insert an initializer_list of characters.
+       *  @param __p  Iterator referencing location in string to insert at.
+       *  @param __l  The initializer_list of characters to insert.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       */
+      void
+      insert(iterator __p, initializer_list<_CharT> __l)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end());
+	this->insert(__p - begin(), __l.begin(), __l.size());
+      }
+#endif // C++11
+
+      /**
+       *  @brief  Insert value of a string.
+       *  @param __pos1  Iterator referencing location in string to insert at.
+       *  @param __str  The string to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts value of @a __str starting at @a __pos1.  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str)
+      { return this->replace(__pos1, size_type(0),
+			     __str._M_data(), __str.size()); }
+
+      /**
+       *  @brief  Insert a substring.
+       *  @param __pos1  Iterator referencing location in string to insert at.
+       *  @param __str  The string to insert.
+       *  @param __pos2  Start of characters in str to insert.
+       *  @param __n  Number of characters to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a pos1 > size() or
+       *  @a __pos2 > @a str.size().
+       *
+       *  Starting at @a pos1, insert @a __n character of @a __str
+       *  beginning with @a __pos2.  If adding characters causes the
+       *  length to exceed max_size(), length_error is thrown.  If @a
+       *  __pos1 is beyond the end of this string or @a __pos2 is
+       *  beyond the end of @a __str, out_of_range is thrown.  The
+       *  value of the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str,
+	     size_type __pos2, size_type __n = npos)
+      { return this->replace(__pos1, size_type(0), __str._M_data()
+			     + __str._M_check(__pos2, "basic_string::insert"),
+			     __str._M_limit(__pos2, __n)); }
+
+      /**
+       *  @brief  Insert a C substring.
+       *  @param __pos  Iterator referencing location in string to insert at.
+       *  @param __s  The C string to insert.
+       *  @param __n  The number of characters to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a __pos is beyond the end of this
+       *  string.
+       *
+       *  Inserts the first @a __n characters of @a __s starting at @a
+       *  __pos.  If adding characters causes the length to exceed
+       *  max_size(), length_error is thrown.  If @a __pos is beyond
+       *  end(), out_of_range is thrown.  The value of the string
+       *  doesn't change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos, const _CharT* __s, size_type __n)
+      { return this->replace(__pos, size_type(0), __s, __n); }
+
+      /**
+       *  @brief  Insert a C string.
+       *  @param __pos  Iterator referencing location in string to insert at.
+       *  @param __s  The C string to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a pos is beyond the end of this
+       *  string.
+       *
+       *  Inserts the first @a n characters of @a __s starting at @a __pos.  If
+       *  adding characters causes the length to exceed max_size(),
+       *  length_error is thrown.  If @a __pos is beyond end(), out_of_range is
+       *  thrown.  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      basic_string&
+      insert(size_type __pos, const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->replace(__pos, size_type(0), __s,
+			     traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Insert multiple characters.
+       *  @param __pos  Index in string to insert at.
+       *  @param __n  Number of characters to insert
+       *  @param __c  The character to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a __pos is beyond the end of this
+       *  string.
+       *
+       *  Inserts @a __n copies of character @a __c starting at index
+       *  @a __pos.  If adding characters causes the length to exceed
+       *  max_size(), length_error is thrown.  If @a __pos > length(),
+       *  out_of_range is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos, size_type __n, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+			      size_type(0), __n, __c); }
+
+      /**
+       *  @brief  Insert one character.
+       *  @param __p  Iterator referencing position in string to insert at.
+       *  @param __c  The character to insert.
+       *  @return  Iterator referencing newly inserted char.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts character @a __c at position referenced by @a __p.
+       *  If adding character causes the length to exceed max_size(),
+       *  length_error is thrown.  If @a __p is beyond end of string,
+       *  out_of_range is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      iterator
+      insert(__const_iterator __p, _CharT __c)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end());
+	const size_type __pos = __p - begin();
+	_M_replace_aux(__pos, size_type(0), size_type(1), __c);
+	return iterator(_M_data() + __pos);
+      }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Insert a string_view.
+       *  @param __pos  Iterator referencing position in string to insert at.
+       *  @param __svt  The object convertible to string_view to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	insert(size_type __pos, const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->insert(__pos, __sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Insert a string_view.
+       *  @param __pos  Iterator referencing position in string to insert at.
+       *  @param __svt  The object convertible to string_view to insert from.
+       *  @param __pos  Iterator referencing position in string_view to insert
+       *  from.
+       *  @param __n    The number of characters to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	insert(size_type __pos1, const _Tp& __svt,
+	       size_type __pos2, size_type __n = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__pos1, size_type(0), __sv.data()
+			       + __sv._M_check(__pos2, "basic_string::insert"),
+			       __sv._M_limit(__pos2, __n));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Remove characters.
+       *  @param __pos  Index of first character to remove (default 0).
+       *  @param __n  Number of characters to remove (default remainder).
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos is beyond the end of this
+       *  string.
+       *
+       *  Removes @a __n characters from this string starting at @a
+       *  __pos.  The length of the string is reduced by @a __n.  If
+       *  there are < @a __n characters to remove, the remainder of
+       *  the string is truncated.  If @a __p is beyond end of string,
+       *  out_of_range is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      erase(size_type __pos = 0, size_type __n = npos)
+      {
+	_M_check(__pos, "basic_string::erase");
+	if (__n == npos)
+	  this->_M_set_length(__pos);
+	else if (__n != 0)
+	  this->_M_erase(__pos, _M_limit(__pos, __n));
+	return *this;
+      }
+
+      /**
+       *  @brief  Remove one character.
+       *  @param __position  Iterator referencing the character to remove.
+       *  @return  iterator referencing same location after removal.
+       *
+       *  Removes the character at @a __position from this string. The value
+       *  of the string doesn't change if an error is thrown.
+      */
+      iterator
+      erase(__const_iterator __position)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__position >= begin()
+				 && __position < end());
+	const size_type __pos = __position - begin();
+	this->_M_erase(__pos, size_type(1));
+	return iterator(_M_data() + __pos);
+      }
+
+      /**
+       *  @brief  Remove a range of characters.
+       *  @param __first  Iterator referencing the first character to remove.
+       *  @param __last  Iterator referencing the end of the range.
+       *  @return  Iterator referencing location of first after removal.
+       *
+       *  Removes the characters in the range [first,last) from this string.
+       *  The value of the string doesn't change if an error is thrown.
+      */
+      iterator
+      erase(__const_iterator __first, __const_iterator __last)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__first >= begin() && __first <= __last
+				 && __last <= end());
+        const size_type __pos = __first - begin();
+	if (__last == end())
+	  this->_M_set_length(__pos);
+	else
+	  this->_M_erase(__pos, __last - __first);
+	return iterator(this->_M_data() + __pos);
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Remove the last character.
+       *
+       *  The string must be non-empty.
+       */
+      void
+      pop_back() noexcept
+      {
+	__glibcxx_assert(!empty());
+	_M_erase(size() - 1, 1);
+      }
+#endif // C++11
+
+      /**
+       *  @brief  Replace characters with value from another string.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n  Number of characters to be replaced.
+       *  @param __str  String to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos is beyond the end of this
+       *  string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos,__pos+__n) from
+       *  this string.  In place, the value of @a __str is inserted.
+       *  If @a __pos is beyond end of string, out_of_range is thrown.
+       *  If the length of the result exceeds max_size(), length_error
+       *  is thrown.  The value of the string doesn't change if an
+       *  error is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n, const basic_string& __str)
+      { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+
+      /**
+       *  @brief  Replace characters with value from another string.
+       *  @param __pos1  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __str  String to insert.
+       *  @param __pos2  Index of first character of str to use.
+       *  @param __n2  Number of characters from str to use.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a __pos1 > size() or @a __pos2 >
+       *  __str.size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos1,__pos1 + n) from this
+       *  string.  In place, the value of @a __str is inserted.  If @a __pos is
+       *  beyond end of string, out_of_range is thrown.  If the length of the
+       *  result exceeds max_size(), length_error is thrown.  The value of the
+       *  string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(size_type __pos1, size_type __n1, const basic_string& __str,
+	      size_type __pos2, size_type __n2 = npos)
+      { return this->replace(__pos1, __n1, __str._M_data()
+			     + __str._M_check(__pos2, "basic_string::replace"),
+			     __str._M_limit(__pos2, __n2)); }
+
+      /**
+       *  @brief  Replace characters with value of a C substring.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __s  C string to insert.
+       *  @param __n2  Number of characters from @a s to use.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos1 > size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos,__pos + __n1)
+       *  from this string.  In place, the first @a __n2 characters of
+       *  @a __s are inserted, or all of @a __s if @a __n2 is too large.  If
+       *  @a __pos is beyond end of string, out_of_range is thrown.  If
+       *  the length of result exceeds max_size(), length_error is
+       *  thrown.  The value of the string doesn't change if an error
+       *  is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s,
+	      size_type __n2)
+      {
+	__glibcxx_requires_string_len(__s, __n2);
+	return _M_replace(_M_check(__pos, "basic_string::replace"),
+			  _M_limit(__pos, __n1), __s, __n2);
+      }
+
+      /**
+       *  @brief  Replace characters with value of a C string.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __s  C string to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos > size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos,__pos + __n1)
+       *  from this string.  In place, the characters of @a __s are
+       *  inserted.  If @a __pos is beyond end of string, out_of_range
+       *  is thrown.  If the length of result exceeds max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->replace(__pos, __n1, __s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Replace characters with multiple characters.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __n2  Number of characters to insert.
+       *  @param __c  Character to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a __pos > size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [pos,pos + n1) from this
+       *  string.  In place, @a __n2 copies of @a __c are inserted.
+       *  If @a __pos is beyond end of string, out_of_range is thrown.
+       *  If the length of result exceeds max_size(), length_error is
+       *  thrown.  The value of the string doesn't change if an error
+       *  is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+			      _M_limit(__pos, __n1), __n2, __c); }
+
+      /**
+       *  @brief  Replace range of characters with string.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __str  String value to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  the value of @a __str is inserted.  If the length of result
+       *  exceeds max_size(), length_error is thrown.  The value of
+       *  the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+	      const basic_string& __str)
+      { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+
+      /**
+       *  @brief  Replace range of characters with C substring.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __s  C string value to insert.
+       *  @param __n  Number of characters from s to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  the first @a __n characters of @a __s are inserted.  If the
+       *  length of result exceeds max_size(), length_error is thrown.
+       *  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+	      const _CharT* __s, size_type __n)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				 && __i2 <= end());
+	return this->replace(__i1 - begin(), __i2 - __i1, __s, __n);
+      }
+
+      /**
+       *  @brief  Replace range of characters with C string.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __s  C string value to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  the characters of @a __s are inserted.  If the length of
+       *  result exceeds max_size(), length_error is thrown.  The
+       *  value of the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->replace(__i1, __i2, __s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Replace range of characters with multiple characters
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __n  Number of characters to insert.
+       *  @param __c  Character to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  @a __n copies of @a __c are inserted.  If the length of
+       *  result exceeds max_size(), length_error is thrown.  The
+       *  value of the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2, size_type __n,
+	      _CharT __c)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				 && __i2 <= end());
+	return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __c);
+      }
+
+      /**
+       *  @brief  Replace range of characters with range.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __k1  Iterator referencing start of range to insert.
+       *  @param __k2  Iterator referencing end of range to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  characters in the range [__k1,__k2) are inserted.  If the
+       *  length of result exceeds max_size(), length_error is thrown.
+       *  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+#if __cplusplus >= 201103L
+      template<class _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+        basic_string&
+        replace(const_iterator __i1, const_iterator __i2,
+		_InputIterator __k1, _InputIterator __k2)
+        {
+	  _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				   && __i2 <= end());
+	  __glibcxx_requires_valid_range(__k1, __k2);
+	  return this->_M_replace_dispatch(__i1, __i2, __k1, __k2,
+					   std::__false_type());
+	}
+#else
+      template<class _InputIterator>
+#ifdef _GLIBCXX_DISAMBIGUATE_REPLACE_INST
+        typename __enable_if_not_native_iterator<_InputIterator>::__type
+#else
+        basic_string&
+#endif
+        replace(iterator __i1, iterator __i2,
+		_InputIterator __k1, _InputIterator __k2)
+        {
+	  _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				   && __i2 <= end());
+	  __glibcxx_requires_valid_range(__k1, __k2);
+	  typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+	  return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+	}
+#endif
+
+      // Specializations for the common case of pointer and iterator:
+      // useful to avoid the overhead of temporary buffering in _M_replace.
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+	      _CharT* __k1, _CharT* __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				 && __i2 <= end());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - begin(), __i2 - __i1,
+			     __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+	      const _CharT* __k1, const _CharT* __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				 && __i2 <= end());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - begin(), __i2 - __i1,
+			     __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+	      iterator __k1, iterator __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				 && __i2 <= end());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - begin(), __i2 - __i1,
+			     __k1.base(), __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+	      const_iterator __k1, const_iterator __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2
+				 && __i2 <= end());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - begin(), __i2 - __i1,
+			     __k1.base(), __k2 - __k1);
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Replace range of characters with initializer_list.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __l  The initializer_list of characters to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  characters in the range [__k1,__k2) are inserted.  If the
+       *  length of result exceeds max_size(), length_error is thrown.
+       *  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      basic_string& replace(const_iterator __i1, const_iterator __i2,
+			    initializer_list<_CharT> __l)
+      { return this->replace(__i1, __i2, __l.begin(), __l.size()); }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Replace range of characters with string_view.
+       *  @param __pos  The position to replace at.
+       *  @param __n    The number of characters to replace.
+       *  @param __svt  The object convertible to string_view to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	replace(size_type __pos, size_type __n, const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__pos, __n, __sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Replace range of characters with string_view.
+       *  @param __pos1  The position to replace at.
+       *  @param __n1    The number of characters to replace.
+       *  @param __svt   The object convertible to string_view to insert from.
+       *  @param __pos2  The position in the string_view to insert from.
+       *  @param __n2    The number of characters to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	replace(size_type __pos1, size_type __n1, const _Tp& __svt,
+		size_type __pos2, size_type __n2 = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__pos1, __n1, __sv.data()
+			       + __sv._M_check(__pos2, "basic_string::replace"),
+			       __sv._M_limit(__pos2, __n2));
+	}
+
+      /**
+       *  @brief  Replace range of characters with string_view.
+       *  @param __i1    An iterator referencing the start position
+          to replace at.
+       *  @param __i2    An iterator referencing the end position
+          for the replace.
+       *  @param __svt   The object convertible to string_view to insert from.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	replace(const_iterator __i1, const_iterator __i2, const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__i1 - begin(), __i2 - __i1, __sv);
+	}
+#endif // C++17
+
+    private:
+      template<class _Integer>
+	basic_string&
+	_M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+			    _Integer __n, _Integer __val, __true_type)
+        { return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __val); }
+
+      template<class _InputIterator>
+	basic_string&
+	_M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+			    _InputIterator __k1, _InputIterator __k2,
+			    __false_type);
+
+      basic_string&
+      _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+		     _CharT __c);
+
+      basic_string&
+      _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+		 const size_type __len2);
+
+      basic_string&
+      _M_append(const _CharT* __s, size_type __n);
+
+    public:
+
+      /**
+       *  @brief  Copy substring into C string.
+       *  @param __s  C string to copy value into.
+       *  @param __n  Number of characters to copy.
+       *  @param __pos  Index of first character to copy.
+       *  @return  Number of characters actually copied
+       *  @throw  std::out_of_range  If __pos > size().
+       *
+       *  Copies up to @a __n characters starting at @a __pos into the
+       *  C string @a __s.  If @a __pos is %greater than size(),
+       *  out_of_range is thrown.
+      */
+      size_type
+      copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+
+      /**
+       *  @brief  Swap contents with another string.
+       *  @param __s  String to swap with.
+       *
+       *  Exchanges the contents of this string with that of @a __s in constant
+       *  time.
+      */
+      void
+      swap(basic_string& __s) _GLIBCXX_NOEXCEPT;
+
+      // String operations:
+      /**
+       *  @brief  Return const pointer to null-terminated contents.
+       *
+       *  This is a handle to internal data.  Do not modify or dire things may
+       *  happen.
+      */
+      const _CharT*
+      c_str() const _GLIBCXX_NOEXCEPT
+      { return _M_data(); }
+
+      /**
+       *  @brief  Return const pointer to contents.
+       *
+       *  This is a pointer to internal data.  It is undefined to modify
+       *  the contents through the returned pointer. To get a pointer that
+       *  allows modifying the contents use @c &str[0] instead,
+       *  (or in C++17 the non-const @c str.data() overload).
+      */
+      const _CharT*
+      data() const _GLIBCXX_NOEXCEPT
+      { return _M_data(); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Return non-const pointer to contents.
+       *
+       *  This is a pointer to the character sequence held by the string.
+       *  Modifying the characters in the sequence is allowed.
+      */
+      _CharT*
+      data() noexcept
+      { return _M_data(); }
+#endif
+
+      /**
+       *  @brief  Return copy of allocator used to construct this string.
+      */
+      allocator_type
+      get_allocator() const _GLIBCXX_NOEXCEPT
+      { return _M_get_allocator(); }
+
+      /**
+       *  @brief  Find position of a C substring.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to search from.
+       *  @param __n  Number of characters from @a s to search for.
+       *  @return  Index of start of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for the first @a
+       *  __n characters in @a __s within this string.  If found,
+       *  returns the index where it begins.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a string.
+       *  @param __str  String to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of start of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for value of @a __str within
+       *  this string.  If found, returns the index where it begins.  If not
+       *  found, returns npos.
+      */
+      size_type
+      find(const basic_string& __str, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find(__str.data(), __pos, __str.size()); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find position of a string_view.
+       *  @param __svt  The object convertible to string_view to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of start of first occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find(const _Tp& __svt, size_type __pos = 0) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find position of a C string.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of start of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for the value of @a
+       *  __s within this string.  If found, returns the index where
+       *  it begins.  If not found, returns npos.
+      */
+      size_type
+      find(const _CharT* __s, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for @a __c within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find last position of a string.
+       *  @param __str  String to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of start of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for value of @a
+       *  __str within this string.  If found, returns the index where
+       *  it begins.  If not found, returns npos.
+      */
+      size_type
+      rfind(const basic_string& __str, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      { return this->rfind(__str.data(), __pos, __str.size()); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find last position of a string_view.
+       *  @param __svt  The object convertible to string_view to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of start of last occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	rfind(const _Tp& __svt, size_type __pos = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->rfind(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find last position of a C substring.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to search back from.
+       *  @param __n  Number of characters from s to search for.
+       *  @return  Index of start of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for the first @a
+       *  __n characters in @a __s within this string.  If found,
+       *  returns the index where it begins.  If not found, returns
+       *  npos.
+      */
+      size_type
+      rfind(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find last position of a C string.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to start search at (default end).
+       *  @return  Index of start of  last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for the value of
+       *  @a __s within this string.  If found, returns the index
+       *  where it begins.  If not found, returns npos.
+      */
+      size_type
+      rfind(const _CharT* __s, size_type __pos = npos) const
+      {
+	__glibcxx_requires_string(__s);
+	return this->rfind(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find last position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for @a __c within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a character of string.
+       *  @param __str  String containing characters to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for one of the
+       *  characters of @a __str within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_first_of(const basic_string& __str, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_first_of(__str.data(), __pos, __str.size()); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find position of a character of a string_view.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_first_of(const _Tp& __svt, size_type __pos = 0) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_first_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find position of a character of C substring.
+       *  @param __s  String containing characters to locate.
+       *  @param __pos  Index of character to search from.
+       *  @param __n  Number of characters from s to search for.
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for one of the
+       *  first @a __n characters of @a __s within this string.  If
+       *  found, returns the index where it was found.  If not found,
+       *  returns npos.
+      */
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a character of C string.
+       *  @param __s  String containing characters to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for one of the
+       *  characters of @a __s within this string.  If found, returns
+       *  the index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_first_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for the character
+       *  @a __c within this string.  If found, returns the index
+       *  where it was found.  If not found, returns npos.
+       *
+       *  Note: equivalent to find(__c, __pos).
+      */
+      size_type
+      find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
+      { return this->find(__c, __pos); }
+
+      /**
+       *  @brief  Find last position of a character of string.
+       *  @param __str  String containing characters to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for one of the
+       *  characters of @a __str within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_last_of(const basic_string& __str, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_last_of(__str.data(), __pos, __str.size()); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find last position of a character of string.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_last_of(const _Tp& __svt, size_type __pos = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_last_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find last position of a character of C substring.
+       *  @param __s  C string containing characters to locate.
+       *  @param __pos  Index of character to search back from.
+       *  @param __n  Number of characters from s to search for.
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for one of the
+       *  first @a __n characters of @a __s within this string.  If
+       *  found, returns the index where it was found.  If not found,
+       *  returns npos.
+      */
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find last position of a character of C string.
+       *  @param __s  C string containing characters to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for one of the
+       *  characters of @a __s within this string.  If found, returns
+       *  the index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_last_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find last position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for @a __c within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+       *
+       *  Note: equivalent to rfind(__c, __pos).
+      */
+      size_type
+      find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT
+      { return this->rfind(__c, __pos); }
+
+      /**
+       *  @brief  Find position of a character not in string.
+       *  @param __str  String containing characters to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character not contained
+       *  in @a __str within this string.  If found, returns the index where it
+       *  was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find position of a character not in a string_view.
+       *  @param __svt  A object convertible to string_view containing
+       *                characters to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_first_not_of(const _Tp& __svt, size_type __pos = 0) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_first_not_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find position of a character not in C substring.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search from.
+       *  @param __n  Number of characters from __s to consider.
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character not
+       *  contained in the first @a __n characters of @a __s within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos,
+			size_type __n) const _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a character not in C string.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character not
+       *  contained in @a __s within this string.  If found, returns
+       *  the index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find position of a different character.
+       *  @param __c  Character to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character
+       *  other than @a __c within this string.  If found, returns the
+       *  index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(_CharT __c, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find last position of a character not in string.
+       *  @param __str  String containing characters to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character
+       *  not contained in @a __str within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find last position of a character not in a string_view.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_last_not_of(const _Tp& __svt, size_type __pos = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_last_not_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find last position of a character not in C substring.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search back from.
+       *  @param __n  Number of characters from s to consider.
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character not
+       *  contained in the first @a __n characters of @a __s within this string.
+       *  If found, returns the index where it was found.  If not found,
+       *  returns npos.
+      */
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos,
+		       size_type __n) const _GLIBCXX_NOEXCEPT;
+      /**
+       *  @brief  Find last position of a character not in C string.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character
+       *  not contained in @a __s within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find last position of a different character.
+       *  @param __c  Character to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character other than
+       *  @a __c within this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      find_last_not_of(_CharT __c, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Get a substring.
+       *  @param __pos  Index of first character (default 0).
+       *  @param __n  Number of characters in substring (default remainder).
+       *  @return  The new string.
+       *  @throw  std::out_of_range  If __pos > size().
+       *
+       *  Construct and return a new string using the @a __n
+       *  characters starting at @a __pos.  If the string is too
+       *  short, use the remainder of the characters.  If @a __pos is
+       *  beyond the end of the string, out_of_range is thrown.
+      */
+      basic_string
+      substr(size_type __pos = 0, size_type __n = npos) const
+      { return basic_string(*this,
+			    _M_check(__pos, "basic_string::substr"), __n); }
+
+      /**
+       *  @brief  Compare to a string.
+       *  @param __str  String to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Returns an integer < 0 if this string is ordered before @a
+       *  __str, 0 if their values are equivalent, or > 0 if this
+       *  string is ordered after @a __str.  Determines the effective
+       *  length rlen of the strings to compare as the smallest of
+       *  size() and str.size().  The function then compares the two
+       *  strings by calling traits::compare(data(), str.data(),rlen).
+       *  If the result of the comparison is nonzero returns it,
+       *  otherwise the shorter one is ordered first.
+      */
+      int
+      compare(const basic_string& __str) const
+      {
+	const size_type __size = this->size();
+	const size_type __osize = __str.size();
+	const size_type __len = std::min(__size, __osize);
+
+	int __r = traits_type::compare(_M_data(), __str.data(), __len);
+	if (!__r)
+	  __r = _S_compare(__size, __osize);
+	return __r;
+      }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Compare to a string_view.
+       *  @param __svt An object convertible to string_view to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, int>
+	compare(const _Tp& __svt) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  const size_type __size = this->size();
+	  const size_type __osize = __sv.size();
+	  const size_type __len = std::min(__size, __osize);
+
+	  int __r = traits_type::compare(_M_data(), __sv.data(), __len);
+	  if (!__r)
+	    __r = _S_compare(__size, __osize);
+	  return __r;
+	}
+
+      /**
+       *  @brief  Compare to a string_view.
+       *  @param __pos  A position in the string to start comparing from.
+       *  @param __n  The number of characters to compare.
+       *  @param __svt  An object convertible to string_view to compare
+       *                against.
+       *  @return  Integer < 0, 0, or > 0.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, int>
+	compare(size_type __pos, size_type __n, const _Tp& __svt) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return __sv_type(*this).substr(__pos, __n).compare(__sv);
+	}
+
+      /**
+       *  @brief  Compare to a string_view.
+       *  @param __pos1  A position in the string to start comparing from.
+       *  @param __n1  The number of characters to compare.
+       *  @param __svt  An object convertible to string_view to compare
+       *                against.
+       *  @param __pos2  A position in the string_view to start comparing from.
+       *  @param __n2  The number of characters to compare.
+       *  @return  Integer < 0, 0, or > 0.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, int>
+	compare(size_type __pos1, size_type __n1, const _Tp& __svt,
+		size_type __pos2, size_type __n2 = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return __sv_type(*this)
+	    .substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Compare substring to a string.
+       *  @param __pos  Index of first character of substring.
+       *  @param __n  Number of characters in substring.
+       *  @param __str  String to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n characters
+       *  starting at @a __pos.  Returns an integer < 0 if the
+       *  substring is ordered before @a __str, 0 if their values are
+       *  equivalent, or > 0 if the substring is ordered after @a
+       *  __str.  Determines the effective length rlen of the strings
+       *  to compare as the smallest of the length of the substring
+       *  and @a __str.size().  The function then compares the two
+       *  strings by calling
+       *  traits::compare(substring.data(),str.data(),rlen).  If the
+       *  result of the comparison is nonzero returns it, otherwise
+       *  the shorter one is ordered first.
+      */
+      int
+      compare(size_type __pos, size_type __n, const basic_string& __str) const;
+
+      /**
+       *  @brief  Compare substring to a substring.
+       *  @param __pos1  Index of first character of substring.
+       *  @param __n1  Number of characters in substring.
+       *  @param __str  String to compare against.
+       *  @param __pos2  Index of first character of substring of str.
+       *  @param __n2  Number of characters in substring of str.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n1
+       *  characters starting at @a __pos1.  Form the substring of @a
+       *  __str from the @a __n2 characters starting at @a __pos2.
+       *  Returns an integer < 0 if this substring is ordered before
+       *  the substring of @a __str, 0 if their values are equivalent,
+       *  or > 0 if this substring is ordered after the substring of
+       *  @a __str.  Determines the effective length rlen of the
+       *  strings to compare as the smallest of the lengths of the
+       *  substrings.  The function then compares the two strings by
+       *  calling
+       *  traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
+       *  If the result of the comparison is nonzero returns it,
+       *  otherwise the shorter one is ordered first.
+      */
+      int
+      compare(size_type __pos1, size_type __n1, const basic_string& __str,
+	      size_type __pos2, size_type __n2 = npos) const;
+
+      /**
+       *  @brief  Compare to a C string.
+       *  @param __s  C string to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Returns an integer < 0 if this string is ordered before @a __s, 0 if
+       *  their values are equivalent, or > 0 if this string is ordered after
+       *  @a __s.  Determines the effective length rlen of the strings to
+       *  compare as the smallest of size() and the length of a string
+       *  constructed from @a __s.  The function then compares the two strings
+       *  by calling traits::compare(data(),s,rlen).  If the result of the
+       *  comparison is nonzero returns it, otherwise the shorter one is
+       *  ordered first.
+      */
+      int
+      compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 5 String::compare specification questionable
+      /**
+       *  @brief  Compare substring to a C string.
+       *  @param __pos  Index of first character of substring.
+       *  @param __n1  Number of characters in substring.
+       *  @param __s  C string to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n1
+       *  characters starting at @a pos.  Returns an integer < 0 if
+       *  the substring is ordered before @a __s, 0 if their values
+       *  are equivalent, or > 0 if the substring is ordered after @a
+       *  __s.  Determines the effective length rlen of the strings to
+       *  compare as the smallest of the length of the substring and
+       *  the length of a string constructed from @a __s.  The
+       *  function then compares the two string by calling
+       *  traits::compare(substring.data(),__s,rlen).  If the result of
+       *  the comparison is nonzero returns it, otherwise the shorter
+       *  one is ordered first.
+      */
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
+      /**
+       *  @brief  Compare substring against a character %array.
+       *  @param __pos  Index of first character of substring.
+       *  @param __n1  Number of characters in substring.
+       *  @param __s  character %array to compare against.
+       *  @param __n2  Number of characters of s.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n1
+       *  characters starting at @a __pos.  Form a string from the
+       *  first @a __n2 characters of @a __s.  Returns an integer < 0
+       *  if this substring is ordered before the string from @a __s,
+       *  0 if their values are equivalent, or > 0 if this substring
+       *  is ordered after the string from @a __s.  Determines the
+       *  effective length rlen of the strings to compare as the
+       *  smallest of the length of the substring and @a __n2.  The
+       *  function then compares the two strings by calling
+       *  traits::compare(substring.data(),s,rlen).  If the result of
+       *  the comparison is nonzero returns it, otherwise the shorter
+       *  one is ordered first.
+       *
+       *  NB: s must have at least n2 characters, &apos;\\0&apos; has
+       *  no special meaning.
+      */
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s,
+	      size_type __n2) const;
+
+      // Allow basic_stringbuf::__xfer_bufptrs to call _M_length:
+      template<typename, typename, typename> friend class basic_stringbuf;
+    };
+_GLIBCXX_END_NAMESPACE_CXX11
+#else  // !_GLIBCXX_USE_CXX11_ABI
+  // Reference-counted COW string implentation
+
+  /**
+   *  @class basic_string basic_string.h <string>
+   *  @brief  Managing sequences of characters and character-like objects.
+   *
+   *  @ingroup strings
+   *  @ingroup sequences
+   *
+   *  @tparam _CharT  Type of character
+   *  @tparam _Traits  Traits for character type, defaults to
+   *                   char_traits<_CharT>.
+   *  @tparam _Alloc  Allocator type, defaults to allocator<_CharT>.
+   *
+   *  Meets the requirements of a <a href="tables.html#65">container</a>, a
+   *  <a href="tables.html#66">reversible container</a>, and a
+   *  <a href="tables.html#67">sequence</a>.  Of the
+   *  <a href="tables.html#68">optional sequence requirements</a>, only
+   *  @c push_back, @c at, and @c %array access are supported.
+   *
+   *  @doctodo
+   *
+   *
+   *  Documentation?  What's that?
+   *  Nathan Myers <ncm@cantrip.org>.
+   *
+   *  A string looks like this:
+   *
+   *  @code
+   *                                        [_Rep]
+   *                                        _M_length
+   *   [basic_string<char_type>]            _M_capacity
+   *   _M_dataplus                          _M_refcount
+   *   _M_p ---------------->               unnamed array of char_type
+   *  @endcode
+   *
+   *  Where the _M_p points to the first character in the string, and
+   *  you cast it to a pointer-to-_Rep and subtract 1 to get a
+   *  pointer to the header.
+   *
+   *  This approach has the enormous advantage that a string object
+   *  requires only one allocation.  All the ugliness is confined
+   *  within a single %pair of inline functions, which each compile to
+   *  a single @a add instruction: _Rep::_M_data(), and
+   *  string::_M_rep(); and the allocation function which gets a
+   *  block of raw bytes and with room enough and constructs a _Rep
+   *  object at the front.
+   *
+   *  The reason you want _M_data pointing to the character %array and
+   *  not the _Rep is so that the debugger can see the string
+   *  contents. (Probably we should add a non-inline member to get
+   *  the _Rep for the debugger to use, so users can check the actual
+   *  string length.)
+   *
+   *  Note that the _Rep object is a POD so that you can have a
+   *  static <em>empty string</em> _Rep object already @a constructed before
+   *  static constructors have run.  The reference-count encoding is
+   *  chosen so that a 0 indicates one reference, so you never try to
+   *  destroy the empty-string _Rep object.
+   *
+   *  All but the last paragraph is considered pretty conventional
+   *  for a C++ string implementation.
+  */
+  // 21.3  Template class basic_string
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    class basic_string
+    {
+      typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+
+      // Types:
+    public:
+      typedef _Traits					    traits_type;
+      typedef typename _Traits::char_type		    value_type;
+      typedef _Alloc					    allocator_type;
+      typedef typename _CharT_alloc_type::size_type	    size_type;
+      typedef typename _CharT_alloc_type::difference_type   difference_type;
+      typedef typename _CharT_alloc_type::reference	    reference;
+      typedef typename _CharT_alloc_type::const_reference   const_reference;
+      typedef typename _CharT_alloc_type::pointer	    pointer;
+      typedef typename _CharT_alloc_type::const_pointer	    const_pointer;
+      typedef __gnu_cxx::__normal_iterator<pointer, basic_string>  iterator;
+      typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+                                                            const_iterator;
+      typedef std::reverse_iterator<const_iterator>	const_reverse_iterator;
+      typedef std::reverse_iterator<iterator>		    reverse_iterator;
+
+    private:
+      // _Rep: string representation
+      //   Invariants:
+      //   1. String really contains _M_length + 1 characters: due to 21.3.4
+      //      must be kept null-terminated.
+      //   2. _M_capacity >= _M_length
+      //      Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
+      //   3. _M_refcount has three states:
+      //      -1: leaked, one reference, no ref-copies allowed, non-const.
+      //       0: one reference, non-const.
+      //     n>0: n + 1 references, operations require a lock, const.
+      //   4. All fields==0 is an empty string, given the extra storage
+      //      beyond-the-end for a null terminator; thus, the shared
+      //      empty string representation needs no constructor.
+
+      struct _Rep_base
+      {
+	size_type		_M_length;
+	size_type		_M_capacity;
+	_Atomic_word		_M_refcount;
+      };
+
+      struct _Rep : _Rep_base
+      {
+	// Types:
+	typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
+
+	// (Public) Data members:
+
+	// The maximum number of individual char_type elements of an
+	// individual string is determined by _S_max_size. This is the
+	// value that will be returned by max_size().  (Whereas npos
+	// is the maximum number of bytes the allocator can allocate.)
+	// If one was to divvy up the theoretical largest size string,
+	// with a terminating character and m _CharT elements, it'd
+	// look like this:
+	// npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
+	// Solving for m:
+	// m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
+	// In addition, this implementation quarters this amount.
+	static const size_type	_S_max_size;
+	static const _CharT	_S_terminal;
+
+	// The following storage is init'd to 0 by the linker, resulting
+        // (carefully) in an empty string with one reference.
+        static size_type _S_empty_rep_storage[];
+
+        static _Rep&
+        _S_empty_rep() _GLIBCXX_NOEXCEPT
+        { 
+	  // NB: Mild hack to avoid strict-aliasing warnings.  Note that
+	  // _S_empty_rep_storage is never modified and the punning should
+	  // be reasonably safe in this case.
+	  void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
+	  return *reinterpret_cast<_Rep*>(__p);
+	}
+
+        bool
+	_M_is_leaked() const _GLIBCXX_NOEXCEPT
+        {
+#if defined(__GTHREADS)
+          // _M_refcount is mutated concurrently by _M_refcopy/_M_dispose,
+          // so we need to use an atomic load. However, _M_is_leaked
+          // predicate does not change concurrently (i.e. the string is either
+          // leaked or not), so a relaxed load is enough.
+          return __atomic_load_n(&this->_M_refcount, __ATOMIC_RELAXED) < 0;
+#else
+          return this->_M_refcount < 0;
+#endif
+        }
+
+        bool
+	_M_is_shared() const _GLIBCXX_NOEXCEPT
+	{
+#if defined(__GTHREADS)
+          // _M_refcount is mutated concurrently by _M_refcopy/_M_dispose,
+          // so we need to use an atomic load. Another thread can drop last
+          // but one reference concurrently with this check, so we need this
+          // load to be acquire to synchronize with release fetch_and_add in
+          // _M_dispose.
+          return __atomic_load_n(&this->_M_refcount, __ATOMIC_ACQUIRE) > 0;
+#else
+          return this->_M_refcount > 0;
+#endif
+        }
+
+        void
+	_M_set_leaked() _GLIBCXX_NOEXCEPT
+        { this->_M_refcount = -1; }
+
+        void
+	_M_set_sharable() _GLIBCXX_NOEXCEPT
+        { this->_M_refcount = 0; }
+
+	void
+	_M_set_length_and_sharable(size_type __n) _GLIBCXX_NOEXCEPT
+	{
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+	  if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+	    {
+	      this->_M_set_sharable();  // One reference.
+	      this->_M_length = __n;
+	      traits_type::assign(this->_M_refdata()[__n], _S_terminal);
+	      // grrr. (per 21.3.4)
+	      // You cannot leave those LWG people alone for a second.
+	    }
+	}
+
+	_CharT*
+	_M_refdata() throw()
+	{ return reinterpret_cast<_CharT*>(this + 1); }
+
+	_CharT*
+	_M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
+	{
+	  return (!_M_is_leaked() && __alloc1 == __alloc2)
+	          ? _M_refcopy() : _M_clone(__alloc1);
+	}
+
+	// Create & Destroy
+	static _Rep*
+	_S_create(size_type, size_type, const _Alloc&);
+
+	void
+	_M_dispose(const _Alloc& __a) _GLIBCXX_NOEXCEPT
+	{
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+	  if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+	    {
+	      // Be race-detector-friendly.  For more info see bits/c++config.
+	      _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
+              // Decrement of _M_refcount is acq_rel, because:
+              // - all but last decrements need to release to synchronize with
+              //   the last decrement that will delete the object.
+              // - the last decrement needs to acquire to synchronize with
+              //   all the previous decrements.
+              // - last but one decrement needs to release to synchronize with
+              //   the acquire load in _M_is_shared that will conclude that
+              //   the object is not shared anymore.
+	      if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
+							 -1) <= 0)
+		{
+		  _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
+		  _M_destroy(__a);
+		}
+	    }
+	}  // XXX MT
+
+	void
+	_M_destroy(const _Alloc&) throw();
+
+	_CharT*
+	_M_refcopy() throw()
+	{
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+	  if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+            __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
+	  return _M_refdata();
+	}  // XXX MT
+
+	_CharT*
+	_M_clone(const _Alloc&, size_type __res = 0);
+      };
+
+      // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
+      struct _Alloc_hider : _Alloc
+      {
+	_Alloc_hider(_CharT* __dat, const _Alloc& __a) _GLIBCXX_NOEXCEPT
+	: _Alloc(__a), _M_p(__dat) { }
+
+	_CharT* _M_p; // The actual data.
+      };
+
+    public:
+      // Data Members (public):
+      // NB: This is an unsigned type, and thus represents the maximum
+      // size that the allocator can hold.
+      ///  Value returned by various member functions when they fail.
+      static const size_type	npos = static_cast<size_type>(-1);
+
+    private:
+      // Data Members (private):
+      mutable _Alloc_hider	_M_dataplus;
+
+      _CharT*
+      _M_data() const _GLIBCXX_NOEXCEPT
+      { return  _M_dataplus._M_p; }
+
+      _CharT*
+      _M_data(_CharT* __p) _GLIBCXX_NOEXCEPT
+      { return (_M_dataplus._M_p = __p); }
+
+      _Rep*
+      _M_rep() const _GLIBCXX_NOEXCEPT
+      { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
+
+      // For the internal use we have functions similar to `begin'/`end'
+      // but they do not call _M_leak.
+      iterator
+      _M_ibegin() const _GLIBCXX_NOEXCEPT
+      { return iterator(_M_data()); }
+
+      iterator
+      _M_iend() const _GLIBCXX_NOEXCEPT
+      { return iterator(_M_data() + this->size()); }
+
+      void
+      _M_leak()    // for use in begin() & non-const op[]
+      {
+	if (!_M_rep()->_M_is_leaked())
+	  _M_leak_hard();
+      }
+
+      size_type
+      _M_check(size_type __pos, const char* __s) const
+      {
+	if (__pos > this->size())
+	  __throw_out_of_range_fmt(__N("%s: __pos (which is %zu) > "
+				       "this->size() (which is %zu)"),
+				   __s, __pos, this->size());
+	return __pos;
+      }
+
+      void
+      _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+      {
+	if (this->max_size() - (this->size() - __n1) < __n2)
+	  __throw_length_error(__N(__s));
+      }
+
+      // NB: _M_limit doesn't check for a bad __pos value.
+      size_type
+      _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
+      {
+	const bool __testoff =  __off < this->size() - __pos;
+	return __testoff ? __off : this->size() - __pos;
+      }
+
+      // True if _Rep and source do not overlap.
+      bool
+      _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT
+      {
+	return (less<const _CharT*>()(__s, _M_data())
+		|| less<const _CharT*>()(_M_data() + this->size(), __s));
+      }
+
+      // When __n = 1 way faster than the general multichar
+      // traits_type::copy/move/assign.
+      static void
+      _M_copy(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
+      {
+	if (__n == 1)
+	  traits_type::assign(*__d, *__s);
+	else
+	  traits_type::copy(__d, __s, __n);
+      }
+
+      static void
+      _M_move(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
+      {
+	if (__n == 1)
+	  traits_type::assign(*__d, *__s);
+	else
+	  traits_type::move(__d, __s, __n);	  
+      }
+
+      static void
+      _M_assign(_CharT* __d, size_type __n, _CharT __c) _GLIBCXX_NOEXCEPT
+      {
+	if (__n == 1)
+	  traits_type::assign(*__d, __c);
+	else
+	  traits_type::assign(__d, __n, __c);	  
+      }
+
+      // _S_copy_chars is a separate template to permit specialization
+      // to optimize for the common case of pointers as iterators.
+      template<class _Iterator>
+        static void
+        _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+        {
+	  for (; __k1 != __k2; ++__k1, (void)++__p)
+	    traits_type::assign(*__p, *__k1); // These types are off.
+	}
+
+      static void
+      _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+      _GLIBCXX_NOEXCEPT
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
+      { _M_copy(__p, __k1, __k2 - __k1); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+      _GLIBCXX_NOEXCEPT
+      { _M_copy(__p, __k1, __k2 - __k1); }
+
+      static int
+      _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT
+      {
+	const difference_type __d = difference_type(__n1 - __n2);
+
+	if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+	  return __gnu_cxx::__numeric_traits<int>::__max;
+	else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+	  return __gnu_cxx::__numeric_traits<int>::__min;
+	else
+	  return int(__d);
+      }
+
+      void
+      _M_mutate(size_type __pos, size_type __len1, size_type __len2);
+
+      void
+      _M_leak_hard();
+
+      static _Rep&
+      _S_empty_rep() _GLIBCXX_NOEXCEPT
+      { return _Rep::_S_empty_rep(); }
+
+#if __cplusplus > 201402L
+      // A helper type for avoiding boiler-plate.
+      typedef basic_string_view<_CharT, _Traits> __sv_type;
+
+      template<typename _Tp, typename _Res>
+	using _If_sv = enable_if_t<
+	  __and_<is_convertible<const _Tp&, __sv_type>,
+		 __not_<is_convertible<const _Tp*, const basic_string*>>,
+		 __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
+	  _Res>;
+
+      // Allows an implicit conversion to __sv_type.
+      static __sv_type
+      _S_to_string_view(__sv_type __svt) noexcept
+      { return __svt; }
+
+      // Wraps a string_view by explicit conversion and thus
+      // allows to add an internal constructor that does not
+      // participate in overload resolution when a string_view
+      // is provided.
+      struct __sv_wrapper
+      {
+	explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
+	__sv_type _M_sv;
+      };
+#endif
+
+    public:
+      // Construct/copy/destroy:
+      // NB: We overload ctors in some cases instead of using default
+      // arguments, per 17.4.4.4 para. 2 item 2.
+
+      /**
+       *  @brief  Default constructor creates an empty string.
+       */
+      basic_string()
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+      : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
+#else
+      : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()){ }
+#endif
+
+      /**
+       *  @brief  Construct an empty string using allocator @a a.
+       */
+      explicit
+      basic_string(const _Alloc& __a);
+
+      // NB: per LWG issue 42, semantics different from IS:
+      /**
+       *  @brief  Construct string with copy of value of @a str.
+       *  @param  __str  Source string.
+       */
+      basic_string(const basic_string& __str);
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2583. no way to supply an allocator for basic_string(str, pos)
+      /**
+       *  @brief  Construct string as copy of a substring.
+       *  @param  __str  Source string.
+       *  @param  __pos  Index of first character to copy from.
+       *  @param  __a  Allocator to use.
+       */
+      basic_string(const basic_string& __str, size_type __pos,
+		   const _Alloc& __a = _Alloc());
+
+      /**
+       *  @brief  Construct string as copy of a substring.
+       *  @param  __str  Source string.
+       *  @param  __pos  Index of first character to copy from.
+       *  @param  __n  Number of characters to copy.
+       */
+      basic_string(const basic_string& __str, size_type __pos,
+		   size_type __n);
+      /**
+       *  @brief  Construct string as copy of a substring.
+       *  @param  __str  Source string.
+       *  @param  __pos  Index of first character to copy from.
+       *  @param  __n  Number of characters to copy.
+       *  @param  __a  Allocator to use.
+       */
+      basic_string(const basic_string& __str, size_type __pos,
+		   size_type __n, const _Alloc& __a);
+
+      /**
+       *  @brief  Construct string initialized by a character %array.
+       *  @param  __s  Source character %array.
+       *  @param  __n  Number of characters to copy.
+       *  @param  __a  Allocator to use (default is default allocator).
+       *
+       *  NB: @a __s must have at least @a __n characters, &apos;\\0&apos;
+       *  has no special meaning.
+       */
+      basic_string(const _CharT* __s, size_type __n,
+		   const _Alloc& __a = _Alloc());
+      /**
+       *  @brief  Construct string as copy of a C string.
+       *  @param  __s  Source C string.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
+      /**
+       *  @brief  Construct string as multiple characters.
+       *  @param  __n  Number of characters.
+       *  @param  __c  Character to use.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Move construct string.
+       *  @param  __str  Source string.
+       *
+       *  The newly-created string contains the exact contents of @a __str.
+       *  @a __str is a valid, but unspecified string.
+       **/
+      basic_string(basic_string&& __str)
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+      noexcept // FIXME C++11: should always be noexcept.
+#endif
+      : _M_dataplus(__str._M_dataplus)
+      {
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+	__str._M_data(_S_empty_rep()._M_refdata());
+#else
+	__str._M_data(_S_construct(size_type(), _CharT(), get_allocator()));
+#endif
+      }
+
+      /**
+       *  @brief  Construct string from an initializer %list.
+       *  @param  __l  std::initializer_list of characters.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
+#endif // C++11
+
+      /**
+       *  @brief  Construct string as copy of a range.
+       *  @param  __beg  Start of range.
+       *  @param  __end  End of range.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      template<class _InputIterator>
+        basic_string(_InputIterator __beg, _InputIterator __end,
+		     const _Alloc& __a = _Alloc());
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Construct string from a substring of a string_view.
+       *  @param  __t   Source object convertible to string view.
+       *  @param  __pos The index of the first character to copy from __t.
+       *  @param  __n   The number of characters to copy from __t.
+       *  @param  __a   Allocator to use.
+       */
+      template<typename _Tp, typename = _If_sv<_Tp, void>>
+	basic_string(const _Tp& __t, size_type __pos, size_type __n,
+		     const _Alloc& __a = _Alloc())
+	: basic_string(_S_to_string_view(__t).substr(__pos, __n), __a) { }
+
+      /**
+       *  @brief  Construct string from a string_view.
+       *  @param  __t  Source object convertible to string view.
+       *  @param  __a  Allocator to use (default is default allocator).
+       */
+      template<typename _Tp, typename = _If_sv<_Tp, void>>
+	explicit
+	basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
+	: basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
+
+      /**
+       *  @brief  Only internally used: Construct string from a string view
+       *          wrapper.
+       *  @param  __svw  string view wrapper.
+       *  @param  __a  Allocator to use.
+       */
+      explicit
+      basic_string(__sv_wrapper __svw, const _Alloc& __a)
+      : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { }
+#endif // C++17
+
+      /**
+       *  @brief  Destroy the string instance.
+       */
+      ~basic_string() _GLIBCXX_NOEXCEPT
+      { _M_rep()->_M_dispose(this->get_allocator()); }
+
+      /**
+       *  @brief  Assign the value of @a str to this string.
+       *  @param  __str  Source string.
+       */
+      basic_string&
+      operator=(const basic_string& __str) 
+      { return this->assign(__str); }
+
+      /**
+       *  @brief  Copy contents of @a s into this string.
+       *  @param  __s  Source null-terminated string.
+       */
+      basic_string&
+      operator=(const _CharT* __s) 
+      { return this->assign(__s); }
+
+      /**
+       *  @brief  Set value to string of length 1.
+       *  @param  __c  Source character.
+       *
+       *  Assigning to a character makes this string length 1 and
+       *  (*this)[0] == @a c.
+       */
+      basic_string&
+      operator=(_CharT __c) 
+      { 
+	this->assign(1, __c); 
+	return *this;
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Move assign the value of @a str to this string.
+       *  @param  __str  Source string.
+       *
+       *  The contents of @a str are moved into this string (without copying).
+       *  @a str is a valid, but unspecified string.
+       **/
+      // PR 58265, this should be noexcept.
+      basic_string&
+      operator=(basic_string&& __str)
+      {
+	// NB: DR 1204.
+	this->swap(__str);
+	return *this;
+      }
+
+      /**
+       *  @brief  Set value to string constructed from initializer %list.
+       *  @param  __l  std::initializer_list.
+       */
+      basic_string&
+      operator=(initializer_list<_CharT> __l)
+      {
+	this->assign(__l.begin(), __l.size());
+	return *this;
+      }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Set value to string constructed from a string_view.
+       *  @param  __svt An object convertible to  string_view.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	operator=(const _Tp& __svt)
+	{ return this->assign(__svt); }
+
+      /**
+       *  @brief  Convert to a string_view.
+       *  @return A string_view.
+       */
+      operator __sv_type() const noexcept
+      { return __sv_type(data(), size()); }
+#endif // C++17
+
+      // Iterators:
+      /**
+       *  Returns a read/write iterator that points to the first character in
+       *  the %string.  Unshares the string.
+       */
+      iterator
+      begin() // FIXME C++11: should be noexcept.
+      {
+	_M_leak();
+	return iterator(_M_data());
+      }
+
+      /**
+       *  Returns a read-only (constant) iterator that points to the first
+       *  character in the %string.
+       */
+      const_iterator
+      begin() const _GLIBCXX_NOEXCEPT
+      { return const_iterator(_M_data()); }
+
+      /**
+       *  Returns a read/write iterator that points one past the last
+       *  character in the %string.  Unshares the string.
+       */
+      iterator
+      end() // FIXME C++11: should be noexcept.
+      {
+	_M_leak();
+	return iterator(_M_data() + this->size());
+      }
+
+      /**
+       *  Returns a read-only (constant) iterator that points one past the
+       *  last character in the %string.
+       */
+      const_iterator
+      end() const _GLIBCXX_NOEXCEPT
+      { return const_iterator(_M_data() + this->size()); }
+
+      /**
+       *  Returns a read/write reverse iterator that points to the last
+       *  character in the %string.  Iteration is done in reverse element
+       *  order.  Unshares the string.
+       */
+      reverse_iterator
+      rbegin() // FIXME C++11: should be noexcept.
+      { return reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to the last character in the %string.  Iteration is done in
+       *  reverse element order.
+       */
+      const_reverse_iterator
+      rbegin() const _GLIBCXX_NOEXCEPT
+      { return const_reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read/write reverse iterator that points to one before the
+       *  first character in the %string.  Iteration is done in reverse
+       *  element order.  Unshares the string.
+       */
+      reverse_iterator
+      rend() // FIXME C++11: should be noexcept.
+      { return reverse_iterator(this->begin()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to one before the first character in the %string.  Iteration
+       *  is done in reverse element order.
+       */
+      const_reverse_iterator
+      rend() const _GLIBCXX_NOEXCEPT
+      { return const_reverse_iterator(this->begin()); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  Returns a read-only (constant) iterator that points to the first
+       *  character in the %string.
+       */
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_data()); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points one past the
+       *  last character in the %string.
+       */
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(this->_M_data() + this->size()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to the last character in the %string.  Iteration is done in
+       *  reverse element order.
+       */
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to one before the first character in the %string.  Iteration
+       *  is done in reverse element order.
+       */
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(this->begin()); }
+#endif
+
+    public:
+      // Capacity:
+      ///  Returns the number of characters in the string, not including any
+      ///  null-termination.
+      size_type
+      size() const _GLIBCXX_NOEXCEPT
+      { return _M_rep()->_M_length; }
+
+      ///  Returns the number of characters in the string, not including any
+      ///  null-termination.
+      size_type
+      length() const _GLIBCXX_NOEXCEPT
+      { return _M_rep()->_M_length; }
+
+      ///  Returns the size() of the largest possible %string.
+      size_type
+      max_size() const _GLIBCXX_NOEXCEPT
+      { return _Rep::_S_max_size; }
+
+      /**
+       *  @brief  Resizes the %string to the specified number of characters.
+       *  @param  __n  Number of characters the %string should contain.
+       *  @param  __c  Character to fill any new elements.
+       *
+       *  This function will %resize the %string to the specified
+       *  number of characters.  If the number is smaller than the
+       *  %string's current size the %string is truncated, otherwise
+       *  the %string is extended and new elements are %set to @a __c.
+       */
+      void
+      resize(size_type __n, _CharT __c);
+
+      /**
+       *  @brief  Resizes the %string to the specified number of characters.
+       *  @param  __n  Number of characters the %string should contain.
+       *
+       *  This function will resize the %string to the specified length.  If
+       *  the new size is smaller than the %string's current size the %string
+       *  is truncated, otherwise the %string is extended and new characters
+       *  are default-constructed.  For basic types such as char, this means
+       *  setting them to 0.
+       */
+      void
+      resize(size_type __n)
+      { this->resize(__n, _CharT()); }
+
+#if __cplusplus >= 201103L
+      ///  A non-binding request to reduce capacity() to size().
+      void
+      shrink_to_fit() _GLIBCXX_NOEXCEPT
+      {
+#if __cpp_exceptions
+	if (capacity() > size())
+	  {
+	    try
+	      { reserve(0); }
+	    catch(...)
+	      { }
+	  }
+#endif
+      }
+#endif
+
+      /**
+       *  Returns the total number of characters that the %string can hold
+       *  before needing to allocate more memory.
+       */
+      size_type
+      capacity() const _GLIBCXX_NOEXCEPT
+      { return _M_rep()->_M_capacity; }
+
+      /**
+       *  @brief  Attempt to preallocate enough memory for specified number of
+       *          characters.
+       *  @param  __res_arg  Number of characters required.
+       *  @throw  std::length_error  If @a __res_arg exceeds @c max_size().
+       *
+       *  This function attempts to reserve enough memory for the
+       *  %string to hold the specified number of characters.  If the
+       *  number requested is more than max_size(), length_error is
+       *  thrown.
+       *
+       *  The advantage of this function is that if optimal code is a
+       *  necessity and the user can determine the string length that will be
+       *  required, the user can reserve the memory in %advance, and thus
+       *  prevent a possible reallocation of memory and copying of %string
+       *  data.
+       */
+      void
+      reserve(size_type __res_arg = 0);
+
+      /**
+       *  Erases the string, making it empty.
+       */
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+      void
+      clear() _GLIBCXX_NOEXCEPT
+      {
+	if (_M_rep()->_M_is_shared())
+	  {
+	    _M_rep()->_M_dispose(this->get_allocator());
+	    _M_data(_S_empty_rep()._M_refdata());
+	  }
+	else
+	  _M_rep()->_M_set_length_and_sharable(0);
+      }
+#else
+      // PR 56166: this should not throw.
+      void
+      clear()
+      { _M_mutate(0, this->size(), 0); }
+#endif
+
+      /**
+       *  Returns true if the %string is empty.  Equivalent to 
+       *  <code>*this == ""</code>.
+       */
+      bool
+      empty() const _GLIBCXX_NOEXCEPT
+      { return this->size() == 0; }
+
+      // Element access:
+      /**
+       *  @brief  Subscript access to the data contained in the %string.
+       *  @param  __pos  The index of the character to access.
+       *  @return  Read-only (constant) reference to the character.
+       *
+       *  This operator allows for easy, array-style, data access.
+       *  Note that data access with this operator is unchecked and
+       *  out_of_range lookups are not defined. (For checked lookups
+       *  see at().)
+       */
+      const_reference
+      operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_assert(__pos <= size());
+	return _M_data()[__pos];
+      }
+
+      /**
+       *  @brief  Subscript access to the data contained in the %string.
+       *  @param  __pos  The index of the character to access.
+       *  @return  Read/write reference to the character.
+       *
+       *  This operator allows for easy, array-style, data access.
+       *  Note that data access with this operator is unchecked and
+       *  out_of_range lookups are not defined. (For checked lookups
+       *  see at().)  Unshares the string.
+       */
+      reference
+      operator[](size_type __pos)
+      {
+        // Allow pos == size() both in C++98 mode, as v3 extension,
+	// and in C++11 mode.
+	__glibcxx_assert(__pos <= size());
+        // In pedantic mode be strict in C++98 mode.
+	_GLIBCXX_DEBUG_PEDASSERT(__cplusplus >= 201103L || __pos < size());
+	_M_leak();
+	return _M_data()[__pos];
+      }
+
+      /**
+       *  @brief  Provides access to the data contained in the %string.
+       *  @param __n The index of the character to access.
+       *  @return  Read-only (const) reference to the character.
+       *  @throw  std::out_of_range  If @a n is an invalid index.
+       *
+       *  This function provides for safer data access.  The parameter is
+       *  first checked that it is in the range of the string.  The function
+       *  throws out_of_range if the check fails.
+       */
+      const_reference
+      at(size_type __n) const
+      {
+	if (__n >= this->size())
+	  __throw_out_of_range_fmt(__N("basic_string::at: __n "
+				       "(which is %zu) >= this->size() "
+				       "(which is %zu)"),
+				   __n, this->size());
+	return _M_data()[__n];
+      }
+
+      /**
+       *  @brief  Provides access to the data contained in the %string.
+       *  @param __n The index of the character to access.
+       *  @return  Read/write reference to the character.
+       *  @throw  std::out_of_range  If @a n is an invalid index.
+       *
+       *  This function provides for safer data access.  The parameter is
+       *  first checked that it is in the range of the string.  The function
+       *  throws out_of_range if the check fails.  Success results in
+       *  unsharing the string.
+       */
+      reference
+      at(size_type __n)
+      {
+	if (__n >= size())
+	  __throw_out_of_range_fmt(__N("basic_string::at: __n "
+				       "(which is %zu) >= this->size() "
+				       "(which is %zu)"),
+				   __n, this->size());
+	_M_leak();
+	return _M_data()[__n];
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  Returns a read/write reference to the data at the first
+       *  element of the %string.
+       */
+      reference
+      front()
+      {
+	__glibcxx_assert(!empty());
+	return operator[](0);
+      }
+
+      /**
+       *  Returns a read-only (constant) reference to the data at the first
+       *  element of the %string.
+       */
+      const_reference
+      front() const noexcept
+      {
+	__glibcxx_assert(!empty());
+	return operator[](0);
+      }
+
+      /**
+       *  Returns a read/write reference to the data at the last
+       *  element of the %string.
+       */
+      reference
+      back()
+      {
+	__glibcxx_assert(!empty());
+	return operator[](this->size() - 1);
+      }
+
+      /**
+       *  Returns a read-only (constant) reference to the data at the
+       *  last element of the %string.
+       */
+      const_reference
+      back() const noexcept
+      {
+	__glibcxx_assert(!empty());
+	return operator[](this->size() - 1);
+      }
+#endif
+
+      // Modifiers:
+      /**
+       *  @brief  Append a string to this string.
+       *  @param __str  The string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(const basic_string& __str)
+      { return this->append(__str); }
+
+      /**
+       *  @brief  Append a C string.
+       *  @param __s  The C string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(const _CharT* __s)
+      { return this->append(__s); }
+
+      /**
+       *  @brief  Append a character.
+       *  @param __c  The character to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(_CharT __c)
+      { 
+	this->push_back(__c);
+	return *this;
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Append an initializer_list of characters.
+       *  @param __l  The initializer_list of characters to be appended.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      operator+=(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Append a string_view.
+       *  @param __svt The object convertible to string_view to be appended.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	operator+=(const _Tp& __svt)
+	{ return this->append(__svt); }
+#endif // C++17
+
+      /**
+       *  @brief  Append a string to this string.
+       *  @param __str  The string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(const basic_string& __str);
+
+      /**
+       *  @brief  Append a substring.
+       *  @param __str  The string to append.
+       *  @param __pos  Index of the first character of str to append.
+       *  @param __n  The number of characters to append.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range if @a __pos is not a valid index.
+       *
+       *  This function appends @a __n characters from @a __str
+       *  starting at @a __pos to this string.  If @a __n is is larger
+       *  than the number of available characters in @a __str, the
+       *  remainder of @a __str is appended.
+       */
+      basic_string&
+      append(const basic_string& __str, size_type __pos, size_type __n = npos);
+
+      /**
+       *  @brief  Append a C substring.
+       *  @param __s  The C string to append.
+       *  @param __n  The number of characters to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(const _CharT* __s, size_type __n);
+
+      /**
+       *  @brief  Append a C string.
+       *  @param __s  The C string to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->append(__s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Append multiple characters.
+       *  @param __n  The number of characters to append.
+       *  @param __c  The character to use.
+       *  @return  Reference to this string.
+       *
+       *  Appends __n copies of __c to this string.
+       */
+      basic_string&
+      append(size_type __n, _CharT __c);
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Append an initializer_list of characters.
+       *  @param __l  The initializer_list of characters to append.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      append(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+#endif // C++11
+
+      /**
+       *  @brief  Append a range of characters.
+       *  @param __first  Iterator referencing the first character to append.
+       *  @param __last  Iterator marking the end of the range.
+       *  @return  Reference to this string.
+       *
+       *  Appends characters in the range [__first,__last) to this string.
+       */
+      template<class _InputIterator>
+        basic_string&
+        append(_InputIterator __first, _InputIterator __last)
+        { return this->replace(_M_iend(), _M_iend(), __first, __last); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Append a string_view.
+       *  @param __svt The object convertible to string_view to be appended.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	append(const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->append(__sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Append a range of characters from a string_view.
+       *  @param __svt The object convertible to string_view to be appended
+       *               from.
+       *  @param __pos The position in the string_view to append from.
+       *  @param __n   The number of characters to append from the string_view.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+        _If_sv<_Tp, basic_string&>
+	append(const _Tp& __svt, size_type __pos, size_type __n = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return append(__sv.data()
+			+ __sv._M_check(__pos, "basic_string::append"),
+			__sv._M_limit(__pos, __n));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Append a single character.
+       *  @param __c  Character to append.
+       */
+      void
+      push_back(_CharT __c)
+      { 
+	const size_type __len = 1 + this->size();
+	if (__len > this->capacity() || _M_rep()->_M_is_shared())
+	  this->reserve(__len);
+	traits_type::assign(_M_data()[this->size()], __c);
+	_M_rep()->_M_set_length_and_sharable(__len);
+      }
+
+      /**
+       *  @brief  Set value to contents of another string.
+       *  @param  __str  Source string to use.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      assign(const basic_string& __str);
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Set value to contents of another string.
+       *  @param  __str  Source string to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets this string to the exact contents of @a __str.
+       *  @a __str is a valid, but unspecified string.
+       */
+      // PR 58265, this should be noexcept.
+      basic_string&
+      assign(basic_string&& __str)
+      {
+	this->swap(__str);
+	return *this;
+      }
+#endif // C++11
+
+      /**
+       *  @brief  Set value to a substring of a string.
+       *  @param __str  The string to use.
+       *  @param __pos  Index of the first character of str.
+       *  @param __n  Number of characters to use.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range if @a pos is not a valid index.
+       *
+       *  This function sets this string to the substring of @a __str
+       *  consisting of @a __n characters at @a __pos.  If @a __n is
+       *  is larger than the number of available characters in @a
+       *  __str, the remainder of @a __str is used.
+       */
+      basic_string&
+      assign(const basic_string& __str, size_type __pos, size_type __n = npos)
+      { return this->assign(__str._M_data()
+			    + __str._M_check(__pos, "basic_string::assign"),
+			    __str._M_limit(__pos, __n)); }
+
+      /**
+       *  @brief  Set value to a C substring.
+       *  @param __s  The C string to use.
+       *  @param __n  Number of characters to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets the value of this string to the first @a __n
+       *  characters of @a __s.  If @a __n is is larger than the number of
+       *  available characters in @a __s, the remainder of @a __s is used.
+       */
+      basic_string&
+      assign(const _CharT* __s, size_type __n);
+
+      /**
+       *  @brief  Set value to contents of a C string.
+       *  @param __s  The C string to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets the value of this string to the value of @a __s.
+       *  The data is copied, so there is no dependence on @a __s once the
+       *  function returns.
+       */
+      basic_string&
+      assign(const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->assign(__s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Set value to multiple characters.
+       *  @param __n  Length of the resulting string.
+       *  @param __c  The character to use.
+       *  @return  Reference to this string.
+       *
+       *  This function sets the value of this string to @a __n copies of
+       *  character @a __c.
+       */
+      basic_string&
+      assign(size_type __n, _CharT __c)
+      { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+
+      /**
+       *  @brief  Set value to a range of characters.
+       *  @param __first  Iterator referencing the first character to append.
+       *  @param __last  Iterator marking the end of the range.
+       *  @return  Reference to this string.
+       *
+       *  Sets value of string to characters in the range [__first,__last).
+      */
+      template<class _InputIterator>
+        basic_string&
+        assign(_InputIterator __first, _InputIterator __last)
+        { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Set value to an initializer_list of characters.
+       *  @param __l  The initializer_list of characters to assign.
+       *  @return  Reference to this string.
+       */
+      basic_string&
+      assign(initializer_list<_CharT> __l)
+      { return this->assign(__l.begin(), __l.size()); }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Set value from a string_view.
+       *  @param __svt The source object convertible to string_view.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	assign(const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->assign(__sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Set value from a range of characters in a string_view.
+       *  @param __svt  The source object convertible to string_view.
+       *  @param __pos  The position in the string_view to assign from.
+       *  @param __n  The number of characters to assign.
+       *  @return  Reference to this string.
+       */
+      template<typename _Tp>
+        _If_sv<_Tp, basic_string&>
+        assign(const _Tp& __svt, size_type __pos, size_type __n = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return assign(__sv.data()
+			+ __sv._M_check(__pos, "basic_string::assign"),
+			__sv._M_limit(__pos, __n));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Insert multiple characters.
+       *  @param __p  Iterator referencing location in string to insert at.
+       *  @param __n  Number of characters to insert
+       *  @param __c  The character to insert.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts @a __n copies of character @a __c starting at the
+       *  position referenced by iterator @a __p.  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      void
+      insert(iterator __p, size_type __n, _CharT __c)
+      {	this->replace(__p, __p, __n, __c);  }
+
+      /**
+       *  @brief  Insert a range of characters.
+       *  @param __p  Iterator referencing location in string to insert at.
+       *  @param __beg  Start of range.
+       *  @param __end  End of range.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts characters in range [__beg,__end).  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      template<class _InputIterator>
+        void
+        insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+        { this->replace(__p, __p, __beg, __end); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Insert an initializer_list of characters.
+       *  @param __p  Iterator referencing location in string to insert at.
+       *  @param __l  The initializer_list of characters to insert.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       */
+      void
+      insert(iterator __p, initializer_list<_CharT> __l)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+	this->insert(__p - _M_ibegin(), __l.begin(), __l.size());
+      }
+#endif // C++11
+
+      /**
+       *  @brief  Insert value of a string.
+       *  @param __pos1  Iterator referencing location in string to insert at.
+       *  @param __str  The string to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts value of @a __str starting at @a __pos1.  If adding
+       *  characters causes the length to exceed max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str)
+      { return this->insert(__pos1, __str, size_type(0), __str.size()); }
+
+      /**
+       *  @brief  Insert a substring.
+       *  @param __pos1  Iterator referencing location in string to insert at.
+       *  @param __str  The string to insert.
+       *  @param __pos2  Start of characters in str to insert.
+       *  @param __n  Number of characters to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a pos1 > size() or
+       *  @a __pos2 > @a str.size().
+       *
+       *  Starting at @a pos1, insert @a __n character of @a __str
+       *  beginning with @a __pos2.  If adding characters causes the
+       *  length to exceed max_size(), length_error is thrown.  If @a
+       *  __pos1 is beyond the end of this string or @a __pos2 is
+       *  beyond the end of @a __str, out_of_range is thrown.  The
+       *  value of the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str,
+	     size_type __pos2, size_type __n = npos)
+      { return this->insert(__pos1, __str._M_data()
+			    + __str._M_check(__pos2, "basic_string::insert"),
+			    __str._M_limit(__pos2, __n)); }
+
+      /**
+       *  @brief  Insert a C substring.
+       *  @param __pos  Iterator referencing location in string to insert at.
+       *  @param __s  The C string to insert.
+       *  @param __n  The number of characters to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a __pos is beyond the end of this
+       *  string.
+       *
+       *  Inserts the first @a __n characters of @a __s starting at @a
+       *  __pos.  If adding characters causes the length to exceed
+       *  max_size(), length_error is thrown.  If @a __pos is beyond
+       *  end(), out_of_range is thrown.  The value of the string
+       *  doesn't change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos, const _CharT* __s, size_type __n);
+
+      /**
+       *  @brief  Insert a C string.
+       *  @param __pos  Iterator referencing location in string to insert at.
+       *  @param __s  The C string to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a pos is beyond the end of this
+       *  string.
+       *
+       *  Inserts the first @a n characters of @a __s starting at @a __pos.  If
+       *  adding characters causes the length to exceed max_size(),
+       *  length_error is thrown.  If @a __pos is beyond end(), out_of_range is
+       *  thrown.  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      basic_string&
+      insert(size_type __pos, const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->insert(__pos, __s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Insert multiple characters.
+       *  @param __pos  Index in string to insert at.
+       *  @param __n  Number of characters to insert
+       *  @param __c  The character to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a __pos is beyond the end of this
+       *  string.
+       *
+       *  Inserts @a __n copies of character @a __c starting at index
+       *  @a __pos.  If adding characters causes the length to exceed
+       *  max_size(), length_error is thrown.  If @a __pos > length(),
+       *  out_of_range is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      insert(size_type __pos, size_type __n, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+			      size_type(0), __n, __c); }
+
+      /**
+       *  @brief  Insert one character.
+       *  @param __p  Iterator referencing position in string to insert at.
+       *  @param __c  The character to insert.
+       *  @return  Iterator referencing newly inserted char.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Inserts character @a __c at position referenced by @a __p.
+       *  If adding character causes the length to exceed max_size(),
+       *  length_error is thrown.  If @a __p is beyond end of string,
+       *  out_of_range is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      iterator
+      insert(iterator __p, _CharT __c)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+	const size_type __pos = __p - _M_ibegin();
+	_M_replace_aux(__pos, size_type(0), size_type(1), __c);
+	_M_rep()->_M_set_leaked();
+	return iterator(_M_data() + __pos);
+      }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Insert a string_view.
+       *  @param __pos  Iterator referencing position in string to insert at.
+       *  @param __svt  The object convertible to string_view to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	insert(size_type __pos, const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->insert(__pos, __sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Insert a string_view.
+       *  @param __pos  Iterator referencing position in string to insert at.
+       *  @param __svt  The object convertible to string_view to insert from.
+       *  @param __pos  Iterator referencing position in string_view to insert
+       *  from.
+       *  @param __n    The number of characters to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+        _If_sv<_Tp, basic_string&>
+        insert(size_type __pos1, const _Tp& __svt,
+	       size_type __pos2, size_type __n = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__pos1, size_type(0), __sv.data()
+			       + __sv._M_check(__pos2, "basic_string::insert"),
+			       __sv._M_limit(__pos2, __n));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Remove characters.
+       *  @param __pos  Index of first character to remove (default 0).
+       *  @param __n  Number of characters to remove (default remainder).
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos is beyond the end of this
+       *  string.
+       *
+       *  Removes @a __n characters from this string starting at @a
+       *  __pos.  The length of the string is reduced by @a __n.  If
+       *  there are < @a __n characters to remove, the remainder of
+       *  the string is truncated.  If @a __p is beyond end of string,
+       *  out_of_range is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      erase(size_type __pos = 0, size_type __n = npos)
+      { 
+	_M_mutate(_M_check(__pos, "basic_string::erase"),
+		  _M_limit(__pos, __n), size_type(0));
+	return *this;
+      }
+
+      /**
+       *  @brief  Remove one character.
+       *  @param __position  Iterator referencing the character to remove.
+       *  @return  iterator referencing same location after removal.
+       *
+       *  Removes the character at @a __position from this string. The value
+       *  of the string doesn't change if an error is thrown.
+      */
+      iterator
+      erase(iterator __position)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
+				 && __position < _M_iend());
+	const size_type __pos = __position - _M_ibegin();
+	_M_mutate(__pos, size_type(1), size_type(0));
+	_M_rep()->_M_set_leaked();
+	return iterator(_M_data() + __pos);
+      }
+
+      /**
+       *  @brief  Remove a range of characters.
+       *  @param __first  Iterator referencing the first character to remove.
+       *  @param __last  Iterator referencing the end of the range.
+       *  @return  Iterator referencing location of first after removal.
+       *
+       *  Removes the characters in the range [first,last) from this string.
+       *  The value of the string doesn't change if an error is thrown.
+      */
+      iterator
+      erase(iterator __first, iterator __last);
+ 
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Remove the last character.
+       *
+       *  The string must be non-empty.
+       */
+      void
+      pop_back() // FIXME C++11: should be noexcept.
+      {
+	__glibcxx_assert(!empty());
+	erase(size() - 1, 1);
+      }
+#endif // C++11
+
+      /**
+       *  @brief  Replace characters with value from another string.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n  Number of characters to be replaced.
+       *  @param __str  String to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos is beyond the end of this
+       *  string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos,__pos+__n) from
+       *  this string.  In place, the value of @a __str is inserted.
+       *  If @a __pos is beyond end of string, out_of_range is thrown.
+       *  If the length of the result exceeds max_size(), length_error
+       *  is thrown.  The value of the string doesn't change if an
+       *  error is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n, const basic_string& __str)
+      { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+
+      /**
+       *  @brief  Replace characters with value from another string.
+       *  @param __pos1  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __str  String to insert.
+       *  @param __pos2  Index of first character of str to use.
+       *  @param __n2  Number of characters from str to use.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a __pos1 > size() or @a __pos2 >
+       *  __str.size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos1,__pos1 + n) from this
+       *  string.  In place, the value of @a __str is inserted.  If @a __pos is
+       *  beyond end of string, out_of_range is thrown.  If the length of the
+       *  result exceeds max_size(), length_error is thrown.  The value of the
+       *  string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(size_type __pos1, size_type __n1, const basic_string& __str,
+	      size_type __pos2, size_type __n2 = npos)
+      { return this->replace(__pos1, __n1, __str._M_data()
+			     + __str._M_check(__pos2, "basic_string::replace"),
+			     __str._M_limit(__pos2, __n2)); }
+
+      /**
+       *  @brief  Replace characters with value of a C substring.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __s  C string to insert.
+       *  @param __n2  Number of characters from @a s to use.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos1 > size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos,__pos + __n1)
+       *  from this string.  In place, the first @a __n2 characters of
+       *  @a __s are inserted, or all of @a __s if @a __n2 is too large.  If
+       *  @a __pos is beyond end of string, out_of_range is thrown.  If
+       *  the length of result exceeds max_size(), length_error is
+       *  thrown.  The value of the string doesn't change if an error
+       *  is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s,
+	      size_type __n2);
+
+      /**
+       *  @brief  Replace characters with value of a C string.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __s  C string to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a pos > size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__pos,__pos + __n1)
+       *  from this string.  In place, the characters of @a __s are
+       *  inserted.  If @a __pos is beyond end of string, out_of_range
+       *  is thrown.  If the length of result exceeds max_size(),
+       *  length_error is thrown.  The value of the string doesn't
+       *  change if an error is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->replace(__pos, __n1, __s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Replace characters with multiple characters.
+       *  @param __pos  Index of first character to replace.
+       *  @param __n1  Number of characters to be replaced.
+       *  @param __n2  Number of characters to insert.
+       *  @param __c  Character to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::out_of_range  If @a __pos > size().
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [pos,pos + n1) from this
+       *  string.  In place, @a __n2 copies of @a __c are inserted.
+       *  If @a __pos is beyond end of string, out_of_range is thrown.
+       *  If the length of result exceeds max_size(), length_error is
+       *  thrown.  The value of the string doesn't change if an error
+       *  is thrown.
+      */
+      basic_string&
+      replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+			      _M_limit(__pos, __n1), __n2, __c); }
+
+      /**
+       *  @brief  Replace range of characters with string.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __str  String value to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  the value of @a __str is inserted.  If the length of result
+       *  exceeds max_size(), length_error is thrown.  The value of
+       *  the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(iterator __i1, iterator __i2, const basic_string& __str)
+      { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+
+      /**
+       *  @brief  Replace range of characters with C substring.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __s  C string value to insert.
+       *  @param __n  Number of characters from s to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  the first @a __n characters of @a __s are inserted.  If the
+       *  length of result exceeds max_size(), length_error is thrown.
+       *  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      basic_string&
+      replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
+      }
+
+      /**
+       *  @brief  Replace range of characters with C string.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __s  C string value to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  the characters of @a __s are inserted.  If the length of
+       *  result exceeds max_size(), length_error is thrown.  The
+       *  value of the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(iterator __i1, iterator __i2, const _CharT* __s)
+      {
+	__glibcxx_requires_string(__s);
+	return this->replace(__i1, __i2, __s, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Replace range of characters with multiple characters
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __n  Number of characters to insert.
+       *  @param __c  Character to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  @a __n copies of @a __c are inserted.  If the length of
+       *  result exceeds max_size(), length_error is thrown.  The
+       *  value of the string doesn't change if an error is thrown.
+      */
+      basic_string&
+      replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
+      }
+
+      /**
+       *  @brief  Replace range of characters with range.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __k1  Iterator referencing start of range to insert.
+       *  @param __k2  Iterator referencing end of range to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  characters in the range [__k1,__k2) are inserted.  If the
+       *  length of result exceeds max_size(), length_error is thrown.
+       *  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      template<class _InputIterator>
+        basic_string&
+        replace(iterator __i1, iterator __i2,
+		_InputIterator __k1, _InputIterator __k2)
+        {
+	  _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				   && __i2 <= _M_iend());
+	  __glibcxx_requires_valid_range(__k1, __k2);
+	  typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+	  return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+	}
+
+      // Specializations for the common case of pointer and iterator:
+      // useful to avoid the overhead of temporary buffering in _M_replace.
+      basic_string&
+      replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(iterator __i1, iterator __i2,
+	      const _CharT* __k1, const _CharT* __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1.base(), __k2 - __k1);
+      }
+
+      basic_string&
+      replace(iterator __i1, iterator __i2,
+	      const_iterator __k1, const_iterator __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1.base(), __k2 - __k1);
+      }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Replace range of characters with initializer_list.
+       *  @param __i1  Iterator referencing start of range to replace.
+       *  @param __i2  Iterator referencing end of range to replace.
+       *  @param __l  The initializer_list of characters to insert.
+       *  @return  Reference to this string.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *
+       *  Removes the characters in the range [__i1,__i2).  In place,
+       *  characters in the range [__k1,__k2) are inserted.  If the
+       *  length of result exceeds max_size(), length_error is thrown.
+       *  The value of the string doesn't change if an error is
+       *  thrown.
+      */
+      basic_string& replace(iterator __i1, iterator __i2,
+			    initializer_list<_CharT> __l)
+      { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // C++11
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Replace range of characters with string_view.
+       *  @param __pos  The position to replace at.
+       *  @param __n    The number of characters to replace.
+       *  @param __svt  The object convertible to string_view to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	replace(size_type __pos, size_type __n, const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__pos, __n, __sv.data(), __sv.size());
+	}
+
+      /**
+       *  @brief  Replace range of characters with string_view.
+       *  @param __pos1  The position to replace at.
+       *  @param __n1    The number of characters to replace.
+       *  @param __svt   The object convertible to string_view to insert from.
+       *  @param __pos2  The position in the string_view to insert from.
+       *  @param __n2    The number of characters to insert.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+        _If_sv<_Tp, basic_string&>
+        replace(size_type __pos1, size_type __n1, const _Tp& __svt,
+		size_type __pos2, size_type __n2 = npos)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__pos1, __n1,
+	      __sv.data() + __sv._M_check(__pos2, "basic_string::replace"),
+	      __sv._M_limit(__pos2, __n2));
+	}
+
+      /**
+       *  @brief  Replace range of characters with string_view.
+       *  @param __i1    An iterator referencing the start position
+          to replace at.
+       *  @param __i2    An iterator referencing the end position
+          for the replace.
+       *  @param __svt   The object convertible to string_view to insert from.
+       *  @return  Reference to this string.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, basic_string&>
+	replace(const_iterator __i1, const_iterator __i2, const _Tp& __svt)
+	{
+	  __sv_type __sv = __svt;
+	  return this->replace(__i1 - begin(), __i2 - __i1, __sv);
+	}
+#endif // C++17
+
+    private:
+      template<class _Integer>
+	basic_string&
+	_M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+			    _Integer __val, __true_type)
+        { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
+
+      template<class _InputIterator>
+	basic_string&
+	_M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+			    _InputIterator __k2, __false_type);
+
+      basic_string&
+      _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+		     _CharT __c);
+
+      basic_string&
+      _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+		      size_type __n2);
+
+      // _S_construct_aux is used to implement the 21.3.1 para 15 which
+      // requires special behaviour if _InIter is an integral type
+      template<class _InIterator>
+        static _CharT*
+        _S_construct_aux(_InIterator __beg, _InIterator __end,
+			 const _Alloc& __a, __false_type)
+	{
+          typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+          return _S_construct(__beg, __end, __a, _Tag());
+	}
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
+      template<class _Integer>
+        static _CharT*
+        _S_construct_aux(_Integer __beg, _Integer __end,
+			 const _Alloc& __a, __true_type)
+        { return _S_construct_aux_2(static_cast<size_type>(__beg),
+				    __end, __a); }
+
+      static _CharT*
+      _S_construct_aux_2(size_type __req, _CharT __c, const _Alloc& __a)
+      { return _S_construct(__req, __c, __a); }
+
+      template<class _InIterator>
+        static _CharT*
+        _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
+	{
+	  typedef typename std::__is_integer<_InIterator>::__type _Integral;
+	  return _S_construct_aux(__beg, __end, __a, _Integral());
+        }
+
+      // For Input Iterators, used in istreambuf_iterators, etc.
+      template<class _InIterator>
+        static _CharT*
+         _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+		      input_iterator_tag);
+
+      // For forward_iterators up to random_access_iterators, used for
+      // string::iterator, _CharT*, etc.
+      template<class _FwdIterator>
+        static _CharT*
+        _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
+		     forward_iterator_tag);
+
+      static _CharT*
+      _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
+
+    public:
+
+      /**
+       *  @brief  Copy substring into C string.
+       *  @param __s  C string to copy value into.
+       *  @param __n  Number of characters to copy.
+       *  @param __pos  Index of first character to copy.
+       *  @return  Number of characters actually copied
+       *  @throw  std::out_of_range  If __pos > size().
+       *
+       *  Copies up to @a __n characters starting at @a __pos into the
+       *  C string @a __s.  If @a __pos is %greater than size(),
+       *  out_of_range is thrown.
+      */
+      size_type
+      copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+
+      /**
+       *  @brief  Swap contents with another string.
+       *  @param __s  String to swap with.
+       *
+       *  Exchanges the contents of this string with that of @a __s in constant
+       *  time.
+      */
+      // PR 58265, this should be noexcept.
+      void
+      swap(basic_string& __s);
+
+      // String operations:
+      /**
+       *  @brief  Return const pointer to null-terminated contents.
+       *
+       *  This is a handle to internal data.  Do not modify or dire things may
+       *  happen.
+      */
+      const _CharT*
+      c_str() const _GLIBCXX_NOEXCEPT
+      { return _M_data(); }
+
+      /**
+       *  @brief  Return const pointer to contents.
+       *
+       *  This is a pointer to internal data.  It is undefined to modify
+       *  the contents through the returned pointer. To get a pointer that
+       *  allows modifying the contents use @c &str[0] instead,
+       *  (or in C++17 the non-const @c str.data() overload).
+      */
+      const _CharT*
+      data() const _GLIBCXX_NOEXCEPT
+      { return _M_data(); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Return non-const pointer to contents.
+       *
+       *  This is a pointer to the character sequence held by the string.
+       *  Modifying the characters in the sequence is allowed.
+      */
+      _CharT*
+      data() noexcept
+      {
+	_M_leak();
+	return _M_data();
+      }
+#endif
+
+      /**
+       *  @brief  Return copy of allocator used to construct this string.
+      */
+      allocator_type
+      get_allocator() const _GLIBCXX_NOEXCEPT
+      { return _M_dataplus; }
+
+      /**
+       *  @brief  Find position of a C substring.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to search from.
+       *  @param __n  Number of characters from @a s to search for.
+       *  @return  Index of start of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for the first @a
+       *  __n characters in @a __s within this string.  If found,
+       *  returns the index where it begins.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a string.
+       *  @param __str  String to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of start of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for value of @a __str within
+       *  this string.  If found, returns the index where it begins.  If not
+       *  found, returns npos.
+      */
+      size_type
+      find(const basic_string& __str, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find(__str.data(), __pos, __str.size()); }
+
+      /**
+       *  @brief  Find position of a C string.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of start of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for the value of @a
+       *  __s within this string.  If found, returns the index where
+       *  it begins.  If not found, returns npos.
+      */
+      size_type
+      find(const _CharT* __s, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for @a __c within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find position of a string_view.
+       *  @param __svt  The object convertible to string_view to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of start of first occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find(const _Tp& __svt, size_type __pos = 0) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find last position of a string.
+       *  @param __str  String to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of start of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for value of @a
+       *  __str within this string.  If found, returns the index where
+       *  it begins.  If not found, returns npos.
+      */
+      size_type
+      rfind(const basic_string& __str, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      { return this->rfind(__str.data(), __pos, __str.size()); }
+
+      /**
+       *  @brief  Find last position of a C substring.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to search back from.
+       *  @param __n  Number of characters from s to search for.
+       *  @return  Index of start of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for the first @a
+       *  __n characters in @a __s within this string.  If found,
+       *  returns the index where it begins.  If not found, returns
+       *  npos.
+      */
+      size_type
+      rfind(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find last position of a C string.
+       *  @param __s  C string to locate.
+       *  @param __pos  Index of character to start search at (default end).
+       *  @return  Index of start of  last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for the value of
+       *  @a __s within this string.  If found, returns the index
+       *  where it begins.  If not found, returns npos.
+      */
+      size_type
+      rfind(const _CharT* __s, size_type __pos = npos) const _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->rfind(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find last position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for @a __c within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT;
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find last position of a string_view.
+       *  @param __svt  The object convertible to string_view to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of start of last occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	rfind(const _Tp& __svt, size_type __pos = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->rfind(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find position of a character of string.
+       *  @param __str  String containing characters to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for one of the
+       *  characters of @a __str within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_first_of(const basic_string& __str, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_first_of(__str.data(), __pos, __str.size()); }
+
+      /**
+       *  @brief  Find position of a character of C substring.
+       *  @param __s  String containing characters to locate.
+       *  @param __pos  Index of character to search from.
+       *  @param __n  Number of characters from s to search for.
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for one of the
+       *  first @a __n characters of @a __s within this string.  If
+       *  found, returns the index where it was found.  If not found,
+       *  returns npos.
+      */
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a character of C string.
+       *  @param __s  String containing characters to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for one of the
+       *  characters of @a __s within this string.  If found, returns
+       *  the index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_first_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for the character
+       *  @a __c within this string.  If found, returns the index
+       *  where it was found.  If not found, returns npos.
+       *
+       *  Note: equivalent to find(__c, __pos).
+      */
+      size_type
+      find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
+      { return this->find(__c, __pos); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find position of a character of a string_view.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to locate.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_first_of(const _Tp& __svt, size_type __pos = 0) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_first_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find last position of a character of string.
+       *  @param __str  String containing characters to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for one of the
+       *  characters of @a __str within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_last_of(const basic_string& __str, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_last_of(__str.data(), __pos, __str.size()); }
+
+      /**
+       *  @brief  Find last position of a character of C substring.
+       *  @param __s  C string containing characters to locate.
+       *  @param __pos  Index of character to search back from.
+       *  @param __n  Number of characters from s to search for.
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for one of the
+       *  first @a __n characters of @a __s within this string.  If
+       *  found, returns the index where it was found.  If not found,
+       *  returns npos.
+      */
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+      _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find last position of a character of C string.
+       *  @param __s  C string containing characters to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for one of the
+       *  characters of @a __s within this string.  If found, returns
+       *  the index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_last_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find last position of a character.
+       *  @param __c  Character to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for @a __c within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+       *
+       *  Note: equivalent to rfind(__c, __pos).
+      */
+      size_type
+      find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT
+      { return this->rfind(__c, __pos); }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find last position of a character of string.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to locate.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+      */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_last_of(const _Tp& __svt, size_type __pos = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_last_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find position of a character not in string.
+       *  @param __str  String containing characters to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character not contained
+       *  in @a __str within this string.  If found, returns the index where it
+       *  was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+
+      /**
+       *  @brief  Find position of a character not in C substring.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search from.
+       *  @param __n  Number of characters from __s to consider.
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character not
+       *  contained in the first @a __n characters of @a __s within
+       *  this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos,
+			size_type __n) const _GLIBCXX_NOEXCEPT;
+
+      /**
+       *  @brief  Find position of a character not in C string.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character not
+       *  contained in @a __s within this string.  If found, returns
+       *  the index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find position of a different character.
+       *  @param __c  Character to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       *
+       *  Starting from @a __pos, searches forward for a character
+       *  other than @a __c within this string.  If found, returns the
+       *  index where it was found.  If not found, returns npos.
+      */
+      size_type
+      find_first_not_of(_CharT __c, size_type __pos = 0) const
+      _GLIBCXX_NOEXCEPT;
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find position of a character not in a string_view.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to avoid.
+       *  @param __pos  Index of character to search from (default 0).
+       *  @return  Index of first occurrence.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_first_not_of(const _Tp& __svt, size_type __pos = 0) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_first_not_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Find last position of a character not in string.
+       *  @param __str  String containing characters to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character
+       *  not contained in @a __str within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+
+      /**
+       *  @brief  Find last position of a character not in C substring.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search back from.
+       *  @param __n  Number of characters from s to consider.
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character not
+       *  contained in the first @a __n characters of @a __s within this string.
+       *  If found, returns the index where it was found.  If not found,
+       *  returns npos.
+      */
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos,
+		       size_type __n) const _GLIBCXX_NOEXCEPT;
+      /**
+       *  @brief  Find last position of a character not in C string.
+       *  @param __s  C string containing characters to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character
+       *  not contained in @a __s within this string.  If found,
+       *  returns the index where it was found.  If not found, returns
+       *  npos.
+      */
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT
+      {
+	__glibcxx_requires_string(__s);
+	return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+      }
+
+      /**
+       *  @brief  Find last position of a different character.
+       *  @param __c  Character to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       *
+       *  Starting from @a __pos, searches backward for a character other than
+       *  @a __c within this string.  If found, returns the index where it was
+       *  found.  If not found, returns npos.
+      */
+      size_type
+      find_last_not_of(_CharT __c, size_type __pos = npos) const
+      _GLIBCXX_NOEXCEPT;
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Find last position of a character not in a string_view.
+       *  @param __svt  An object convertible to string_view containing
+       *                characters to avoid.
+       *  @param __pos  Index of character to search back from (default end).
+       *  @return  Index of last occurrence.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, size_type>
+	find_last_not_of(const _Tp& __svt, size_type __pos = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return this->find_last_not_of(__sv.data(), __pos, __sv.size());
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Get a substring.
+       *  @param __pos  Index of first character (default 0).
+       *  @param __n  Number of characters in substring (default remainder).
+       *  @return  The new string.
+       *  @throw  std::out_of_range  If __pos > size().
+       *
+       *  Construct and return a new string using the @a __n
+       *  characters starting at @a __pos.  If the string is too
+       *  short, use the remainder of the characters.  If @a __pos is
+       *  beyond the end of the string, out_of_range is thrown.
+      */
+      basic_string
+      substr(size_type __pos = 0, size_type __n = npos) const
+      { return basic_string(*this,
+			    _M_check(__pos, "basic_string::substr"), __n); }
+
+      /**
+       *  @brief  Compare to a string.
+       *  @param __str  String to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Returns an integer < 0 if this string is ordered before @a
+       *  __str, 0 if their values are equivalent, or > 0 if this
+       *  string is ordered after @a __str.  Determines the effective
+       *  length rlen of the strings to compare as the smallest of
+       *  size() and str.size().  The function then compares the two
+       *  strings by calling traits::compare(data(), str.data(),rlen).
+       *  If the result of the comparison is nonzero returns it,
+       *  otherwise the shorter one is ordered first.
+      */
+      int
+      compare(const basic_string& __str) const
+      {
+	const size_type __size = this->size();
+	const size_type __osize = __str.size();
+	const size_type __len = std::min(__size, __osize);
+
+	int __r = traits_type::compare(_M_data(), __str.data(), __len);
+	if (!__r)
+	  __r = _S_compare(__size, __osize);
+	return __r;
+      }
+
+#if __cplusplus > 201402L
+      /**
+       *  @brief  Compare to a string_view.
+       *  @param __svt An object convertible to string_view to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, int>
+	compare(const _Tp& __svt) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	   __sv_type __sv = __svt;
+	  const size_type __size = this->size();
+	  const size_type __osize = __sv.size();
+	  const size_type __len = std::min(__size, __osize);
+
+	  int __r = traits_type::compare(_M_data(), __sv.data(), __len);
+	  if (!__r)
+	    __r = _S_compare(__size, __osize);
+	  return __r;
+	}
+
+      /**
+       *  @brief  Compare to a string_view.
+       *  @param __pos  A position in the string to start comparing from.
+       *  @param __n  The number of characters to compare.
+       *  @param __svt  An object convertible to string_view to compare
+       *                against.
+       *  @return  Integer < 0, 0, or > 0.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, int>
+	compare(size_type __pos, size_type __n, const _Tp& __svt) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return __sv_type(*this).substr(__pos, __n).compare(__sv);
+	}
+
+      /**
+       *  @brief  Compare to a string_view.
+       *  @param __pos1  A position in the string to start comparing from.
+       *  @param __n1  The number of characters to compare.
+       *  @param __svt   An object convertible to string_view to compare
+       *                 against.
+       *  @param __pos2  A position in the string_view to start comparing from.
+       *  @param __n2  The number of characters to compare.
+       *  @return  Integer < 0, 0, or > 0.
+       */
+      template<typename _Tp>
+	_If_sv<_Tp, int>
+	compare(size_type __pos1, size_type __n1, const _Tp& __svt,
+		size_type __pos2, size_type __n2 = npos) const
+	noexcept(is_same<_Tp, __sv_type>::value)
+	{
+	  __sv_type __sv = __svt;
+	  return __sv_type(*this)
+	    .substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
+	}
+#endif // C++17
+
+      /**
+       *  @brief  Compare substring to a string.
+       *  @param __pos  Index of first character of substring.
+       *  @param __n  Number of characters in substring.
+       *  @param __str  String to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n characters
+       *  starting at @a __pos.  Returns an integer < 0 if the
+       *  substring is ordered before @a __str, 0 if their values are
+       *  equivalent, or > 0 if the substring is ordered after @a
+       *  __str.  Determines the effective length rlen of the strings
+       *  to compare as the smallest of the length of the substring
+       *  and @a __str.size().  The function then compares the two
+       *  strings by calling
+       *  traits::compare(substring.data(),str.data(),rlen).  If the
+       *  result of the comparison is nonzero returns it, otherwise
+       *  the shorter one is ordered first.
+      */
+      int
+      compare(size_type __pos, size_type __n, const basic_string& __str) const;
+
+      /**
+       *  @brief  Compare substring to a substring.
+       *  @param __pos1  Index of first character of substring.
+       *  @param __n1  Number of characters in substring.
+       *  @param __str  String to compare against.
+       *  @param __pos2  Index of first character of substring of str.
+       *  @param __n2  Number of characters in substring of str.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n1
+       *  characters starting at @a __pos1.  Form the substring of @a
+       *  __str from the @a __n2 characters starting at @a __pos2.
+       *  Returns an integer < 0 if this substring is ordered before
+       *  the substring of @a __str, 0 if their values are equivalent,
+       *  or > 0 if this substring is ordered after the substring of
+       *  @a __str.  Determines the effective length rlen of the
+       *  strings to compare as the smallest of the lengths of the
+       *  substrings.  The function then compares the two strings by
+       *  calling
+       *  traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
+       *  If the result of the comparison is nonzero returns it,
+       *  otherwise the shorter one is ordered first.
+      */
+      int
+      compare(size_type __pos1, size_type __n1, const basic_string& __str,
+	      size_type __pos2, size_type __n2 = npos) const;
+
+      /**
+       *  @brief  Compare to a C string.
+       *  @param __s  C string to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Returns an integer < 0 if this string is ordered before @a __s, 0 if
+       *  their values are equivalent, or > 0 if this string is ordered after
+       *  @a __s.  Determines the effective length rlen of the strings to
+       *  compare as the smallest of size() and the length of a string
+       *  constructed from @a __s.  The function then compares the two strings
+       *  by calling traits::compare(data(),s,rlen).  If the result of the
+       *  comparison is nonzero returns it, otherwise the shorter one is
+       *  ordered first.
+      */
+      int
+      compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 5 String::compare specification questionable
+      /**
+       *  @brief  Compare substring to a C string.
+       *  @param __pos  Index of first character of substring.
+       *  @param __n1  Number of characters in substring.
+       *  @param __s  C string to compare against.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n1
+       *  characters starting at @a pos.  Returns an integer < 0 if
+       *  the substring is ordered before @a __s, 0 if their values
+       *  are equivalent, or > 0 if the substring is ordered after @a
+       *  __s.  Determines the effective length rlen of the strings to
+       *  compare as the smallest of the length of the substring and
+       *  the length of a string constructed from @a __s.  The
+       *  function then compares the two string by calling
+       *  traits::compare(substring.data(),__s,rlen).  If the result of
+       *  the comparison is nonzero returns it, otherwise the shorter
+       *  one is ordered first.
+      */
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
+      /**
+       *  @brief  Compare substring against a character %array.
+       *  @param __pos  Index of first character of substring.
+       *  @param __n1  Number of characters in substring.
+       *  @param __s  character %array to compare against.
+       *  @param __n2  Number of characters of s.
+       *  @return  Integer < 0, 0, or > 0.
+       *
+       *  Form the substring of this string from the @a __n1
+       *  characters starting at @a __pos.  Form a string from the
+       *  first @a __n2 characters of @a __s.  Returns an integer < 0
+       *  if this substring is ordered before the string from @a __s,
+       *  0 if their values are equivalent, or > 0 if this substring
+       *  is ordered after the string from @a __s.  Determines the
+       *  effective length rlen of the strings to compare as the
+       *  smallest of the length of the substring and @a __n2.  The
+       *  function then compares the two strings by calling
+       *  traits::compare(substring.data(),s,rlen).  If the result of
+       *  the comparison is nonzero returns it, otherwise the shorter
+       *  one is ordered first.
+       *
+       *  NB: s must have at least n2 characters, &apos;\\0&apos; has
+       *  no special meaning.
+      */
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s,
+	      size_type __n2) const;
+
+# ifdef _GLIBCXX_TM_TS_INTERNAL
+      friend void
+      ::_txnal_cow_string_C1_for_exceptions(void* that, const char* s,
+					    void* exc);
+      friend const char*
+      ::_txnal_cow_string_c_str(const void *that);
+      friend void
+      ::_txnal_cow_string_D1(void *that);
+      friend void
+      ::_txnal_cow_string_D1_commit(void *that);
+# endif
+  };
+#endif  // !_GLIBCXX_USE_CXX11_ABI
+
+  // operator+
+  /**
+   *  @brief  Concatenate two strings.
+   *  @param __lhs  First string.
+   *  @param __rhs  Last string.
+   *  @return  New string with value of @a __lhs followed by @a __rhs.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  /**
+   *  @brief  Concatenate C string and string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Last string.
+   *  @return  New string with value of @a __lhs followed by @a __rhs.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT,_Traits,_Alloc>
+    operator+(const _CharT* __lhs,
+	      const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+  /**
+   *  @brief  Concatenate character and string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Last string.
+   *  @return  New string with @a __lhs followed by @a __rhs.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT,_Traits,_Alloc>
+    operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+  /**
+   *  @brief  Concatenate string and C string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Last string.
+   *  @return  New string with @a __lhs followed by @a __rhs.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      const _CharT* __rhs)
+    {
+      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  /**
+   *  @brief  Concatenate string and character.
+   *  @param __lhs  First string.
+   *  @param __rhs  Last string.
+   *  @return  New string with @a __lhs followed by @a __rhs.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
+    {
+      typedef basic_string<_CharT, _Traits, _Alloc>	__string_type;
+      typedef typename __string_type::size_type		__size_type;
+      __string_type __str(__lhs);
+      __str.append(__size_type(1), __rhs);
+      return __str;
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return std::move(__lhs.append(__rhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+	      basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    {
+      const auto __size = __lhs.size() + __rhs.size();
+      const bool __cond = (__size > __lhs.capacity()
+			   && __size <= __rhs.capacity());
+      return __cond ? std::move(__rhs.insert(0, __lhs))
+	            : std::move(__lhs.append(__rhs));
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const _CharT* __lhs,
+	      basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(_CharT __lhs,
+	      basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, 1, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+	      const _CharT* __rhs)
+    { return std::move(__lhs.append(__rhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+	      _CharT __rhs)
+    { return std::move(__lhs.append(1, __rhs)); }
+#endif
+
+  // operator ==
+  /**
+   *  @brief  Test equivalence of two strings.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *  @return  True if @a __lhs.compare(@a __rhs) == 0.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT
+    { return __lhs.compare(__rhs) == 0; }
+
+  template<typename _CharT>
+    inline
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
+    operator==(const basic_string<_CharT>& __lhs,
+	       const basic_string<_CharT>& __rhs) _GLIBCXX_NOEXCEPT
+    { return (__lhs.size() == __rhs.size()
+	      && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+						    __lhs.size())); }
+
+  /**
+   *  @brief  Test equivalence of C string and string.
+   *  @param __lhs  C string.
+   *  @param __rhs  String.
+   *  @return  True if @a __rhs.compare(@a __lhs) == 0.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const _CharT* __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) == 0; }
+
+  /**
+   *  @brief  Test equivalence of string and C string.
+   *  @param __lhs  String.
+   *  @param __rhs  C string.
+   *  @return  True if @a __lhs.compare(@a __rhs) == 0.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) == 0; }
+
+  // operator !=
+  /**
+   *  @brief  Test difference of two strings.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *  @return  True if @a __lhs.compare(@a __rhs) != 0.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT
+    { return !(__lhs == __rhs); }
+
+  /**
+   *  @brief  Test difference of C string and string.
+   *  @param __lhs  C string.
+   *  @param __rhs  String.
+   *  @return  True if @a __rhs.compare(@a __lhs) != 0.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const _CharT* __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return !(__lhs == __rhs); }
+
+  /**
+   *  @brief  Test difference of string and C string.
+   *  @param __lhs  String.
+   *  @param __rhs  C string.
+   *  @return  True if @a __lhs.compare(@a __rhs) != 0.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const _CharT* __rhs)
+    { return !(__lhs == __rhs); }
+
+  // operator <
+  /**
+   *  @brief  Test if string precedes string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *  @return  True if @a __lhs precedes @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT
+    { return __lhs.compare(__rhs) < 0; }
+
+  /**
+   *  @brief  Test if string precedes C string.
+   *  @param __lhs  String.
+   *  @param __rhs  C string.
+   *  @return  True if @a __lhs precedes @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      const _CharT* __rhs)
+    { return __lhs.compare(__rhs) < 0; }
+
+  /**
+   *  @brief  Test if C string precedes string.
+   *  @param __lhs  C string.
+   *  @param __rhs  String.
+   *  @return  True if @a __lhs precedes @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const _CharT* __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) > 0; }
+
+  // operator >
+  /**
+   *  @brief  Test if string follows string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *  @return  True if @a __lhs follows @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT
+    { return __lhs.compare(__rhs) > 0; }
+
+  /**
+   *  @brief  Test if string follows C string.
+   *  @param __lhs  String.
+   *  @param __rhs  C string.
+   *  @return  True if @a __lhs follows @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	      const _CharT* __rhs)
+    { return __lhs.compare(__rhs) > 0; }
+
+  /**
+   *  @brief  Test if C string follows string.
+   *  @param __lhs  C string.
+   *  @param __rhs  String.
+   *  @return  True if @a __lhs follows @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const _CharT* __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) < 0; }
+
+  // operator <=
+  /**
+   *  @brief  Test if string doesn't follow string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *  @return  True if @a __lhs doesn't follow @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT
+    { return __lhs.compare(__rhs) <= 0; }
+
+  /**
+   *  @brief  Test if string doesn't follow C string.
+   *  @param __lhs  String.
+   *  @param __rhs  C string.
+   *  @return  True if @a __lhs doesn't follow @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) <= 0; }
+
+  /**
+   *  @brief  Test if C string doesn't follow string.
+   *  @param __lhs  C string.
+   *  @param __rhs  String.
+   *  @return  True if @a __lhs doesn't follow @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const _CharT* __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) >= 0; }
+
+  // operator >=
+  /**
+   *  @brief  Test if string doesn't precede string.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *  @return  True if @a __lhs doesn't precede @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT
+    { return __lhs.compare(__rhs) >= 0; }
+
+  /**
+   *  @brief  Test if string doesn't precede C string.
+   *  @param __lhs  String.
+   *  @param __rhs  C string.
+   *  @return  True if @a __lhs doesn't precede @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) >= 0; }
+
+  /**
+   *  @brief  Test if C string doesn't precede string.
+   *  @param __lhs  C string.
+   *  @param __rhs  String.
+   *  @return  True if @a __lhs doesn't precede @a __rhs.  False otherwise.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const _CharT* __lhs,
+	     const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) <= 0; }
+
+  /**
+   *  @brief  Swap contents of two strings.
+   *  @param __lhs  First string.
+   *  @param __rhs  Second string.
+   *
+   *  Exchanges the contents of @a __lhs and @a __rhs in constant time.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline void
+    swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
+	 basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
+    { __lhs.swap(__rhs); }
+
+
+  /**
+   *  @brief  Read stream into a string.
+   *  @param __is  Input stream.
+   *  @param __str  Buffer to store into.
+   *  @return  Reference to the input stream.
+   *
+   *  Stores characters from @a __is into @a __str until whitespace is
+   *  found, the end of the stream is encountered, or str.max_size()
+   *  is reached.  If is.width() is non-zero, that is the limit on the
+   *  number of characters stored into @a __str.  Any previous
+   *  contents of @a __str are erased.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __is,
+	       basic_string<_CharT, _Traits, _Alloc>& __str);
+
+  template<>
+    basic_istream<char>&
+    operator>>(basic_istream<char>& __is, basic_string<char>& __str);
+
+  /**
+   *  @brief  Write string to a stream.
+   *  @param __os  Output stream.
+   *  @param __str  String to write out.
+   *  @return  Reference to the output stream.
+   *
+   *  Output characters of @a __str into os following the same rules as for
+   *  writing a C string.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os,
+	       const basic_string<_CharT, _Traits, _Alloc>& __str)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 586. string inserter not a formatted function
+      return __ostream_insert(__os, __str.data(), __str.size());
+    }
+
+  /**
+   *  @brief  Read a line from stream into a string.
+   *  @param __is  Input stream.
+   *  @param __str  Buffer to store into.
+   *  @param __delim  Character marking end of line.
+   *  @return  Reference to the input stream.
+   *
+   *  Stores characters from @a __is into @a __str until @a __delim is
+   *  found, the end of the stream is encountered, or str.max_size()
+   *  is reached.  Any previous contents of @a __str are erased.  If
+   *  @a __delim is encountered, it is extracted but not stored into
+   *  @a __str.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __is,
+	    basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+
+  /**
+   *  @brief  Read a line from stream into a string.
+   *  @param __is  Input stream.
+   *  @param __str  Buffer to store into.
+   *  @return  Reference to the input stream.
+   *
+   *  Stores characters from is into @a __str until &apos;\n&apos; is
+   *  found, the end of the stream is encountered, or str.max_size()
+   *  is reached.  Any previous contents of @a __str are erased.  If
+   *  end of line is encountered, it is extracted but not stored into
+   *  @a __str.
+   */
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __is,
+	    basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return std::getline(__is, __str, __is.widen('\n')); }
+
+#if __cplusplus >= 201103L
+  /// Read a line from an rvalue stream into a string.
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>&& __is,
+	    basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+    { return std::getline(__is, __str, __delim); }
+
+  /// Read a line from an rvalue stream into a string.
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>&& __is,
+	    basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return std::getline(__is, __str); }
+#endif
+
+  template<>
+    basic_istream<char>&
+    getline(basic_istream<char>& __in, basic_string<char>& __str,
+	    char __delim);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
+	    wchar_t __delim);
+#endif  
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#if __cplusplus >= 201103L
+
+#include <ext/string_conversions.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+
+#if _GLIBCXX_USE_C99_STDLIB
+  // 21.4 Numeric Conversions [string.conversions].
+  inline int
+  stoi(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+					__idx, __base); }
+
+  inline long
+  stol(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+			     __idx, __base); }
+
+  inline unsigned long
+  stoul(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+			     __idx, __base); }
+
+  inline long long
+  stoll(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+			     __idx, __base); }
+
+  inline unsigned long long
+  stoull(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+			     __idx, __base); }
+
+  // NB: strtof vs strtod.
+  inline float
+  stof(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+  inline double
+  stod(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+  inline long double
+  stold(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+#endif // _GLIBCXX_USE_C99_STDLIB
+
+#if _GLIBCXX_USE_C99_STDIO
+  // NB: (v)snprintf vs sprintf.
+
+  // DR 1261.
+  inline string
+  to_string(int __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(int),
+					   "%d", __val); }
+
+  inline string
+  to_string(unsigned __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+					   4 * sizeof(unsigned),
+					   "%u", __val); }
+
+  inline string
+  to_string(long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(long),
+					   "%ld", __val); }
+
+  inline string
+  to_string(unsigned long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+					   4 * sizeof(unsigned long),
+					   "%lu", __val); }
+
+  inline string
+  to_string(long long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+					   4 * sizeof(long long),
+					   "%lld", __val); }
+
+  inline string
+  to_string(unsigned long long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+					   4 * sizeof(unsigned long long),
+					   "%llu", __val); }
+
+  inline string
+  to_string(float __val)
+  {
+    const int __n = 
+      __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+					   "%f", __val);
+  }
+
+  inline string
+  to_string(double __val)
+  {
+    const int __n = 
+      __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+					   "%f", __val);
+  }
+
+  inline string
+  to_string(long double __val)
+  {
+    const int __n = 
+      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+					   "%Lf", __val);
+  }
+#endif // _GLIBCXX_USE_C99_STDIO
+
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_WCHAR
+  inline int 
+  stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+					__idx, __base); }
+
+  inline long 
+  stol(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+			     __idx, __base); }
+
+  inline unsigned long
+  stoul(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+			     __idx, __base); }
+
+  inline long long
+  stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+			     __idx, __base); }
+
+  inline unsigned long long
+  stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+			     __idx, __base); }
+
+  // NB: wcstof vs wcstod.
+  inline float
+  stof(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+  inline double
+  stod(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+  inline long double
+  stold(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+#ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
+  // DR 1261.
+  inline wstring
+  to_wstring(int __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(int),
+					    L"%d", __val); }
+
+  inline wstring
+  to_wstring(unsigned __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+					    4 * sizeof(unsigned),
+					    L"%u", __val); }
+
+  inline wstring
+  to_wstring(long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(long),
+					    L"%ld", __val); }
+
+  inline wstring
+  to_wstring(unsigned long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+					    4 * sizeof(unsigned long),
+					    L"%lu", __val); }
+
+  inline wstring
+  to_wstring(long long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+					    4 * sizeof(long long),
+					    L"%lld", __val); }
+
+  inline wstring
+  to_wstring(unsigned long long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+					    4 * sizeof(unsigned long long),
+					    L"%llu", __val); }
+
+  inline wstring
+  to_wstring(float __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+					    L"%f", __val);
+  }
+
+  inline wstring
+  to_wstring(double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+					    L"%f", __val);
+  }
+
+  inline wstring
+  to_wstring(long double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+					    L"%Lf", __val);
+  }
+#endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF
+#endif // _GLIBCXX_USE_WCHAR_T && _GLIBCXX_USE_C99_WCHAR
+
+_GLIBCXX_END_NAMESPACE_CXX11
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* C++11 */
+
+#if __cplusplus >= 201103L
+
+#include <bits/functional_hash.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // DR 1182.
+
+#ifndef _GLIBCXX_COMPATIBILITY_CXX0X
+  /// std::hash specialization for string.
+  template<>
+    struct hash<string>
+    : public __hash_base<size_t, string>
+    {
+      size_t
+      operator()(const string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(), __s.length()); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<string>> : std::false_type
+    { };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  /// std::hash specialization for wstring.
+  template<>
+    struct hash<wstring>
+    : public __hash_base<size_t, wstring>
+    {
+      size_t
+      operator()(const wstring& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(wchar_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<wstring>> : std::false_type
+    { };
+#endif
+#endif /* _GLIBCXX_COMPATIBILITY_CXX0X */
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+  /// std::hash specialization for u16string.
+  template<>
+    struct hash<u16string>
+    : public __hash_base<size_t, u16string>
+    {
+      size_t
+      operator()(const u16string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(char16_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<u16string>> : std::false_type
+    { };
+
+  /// std::hash specialization for u32string.
+  template<>
+    struct hash<u32string>
+    : public __hash_base<size_t, u32string>
+    {
+      size_t
+      operator()(const u32string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(char32_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<u32string>> : std::false_type
+    { };
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+
+#if __cplusplus > 201103L
+
+#define __cpp_lib_string_udls 201304
+
+  inline namespace literals
+  {
+  inline namespace string_literals
+  {
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+    _GLIBCXX_DEFAULT_ABI_TAG
+    inline basic_string<char>
+    operator""s(const char* __str, size_t __len)
+    { return basic_string<char>{__str, __len}; }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+    _GLIBCXX_DEFAULT_ABI_TAG
+    inline basic_string<wchar_t>
+    operator""s(const wchar_t* __str, size_t __len)
+    { return basic_string<wchar_t>{__str, __len}; }
+#endif
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+    _GLIBCXX_DEFAULT_ABI_TAG
+    inline basic_string<char16_t>
+    operator""s(const char16_t* __str, size_t __len)
+    { return basic_string<char16_t>{__str, __len}; }
+
+    _GLIBCXX_DEFAULT_ABI_TAG
+    inline basic_string<char32_t>
+    operator""s(const char32_t* __str, size_t __len)
+    { return basic_string<char32_t>{__str, __len}; }
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+  } // inline namespace string_literals
+  } // inline namespace literals
+
+#endif // __cplusplus > 201103L
+
+} // namespace std
+
+#endif // C++11
+
+#endif /* _BASIC_STRING_H */

+ 1654 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/basic_string.tcc

@@ -0,0 +1,1654 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/basic_string.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{string}
+ */
+
+//
+// ISO C++ 14882: 21  Strings library
+//
+
+// Written by Jason Merrill based upon the specification by Takanori Adachi
+// in ANSI X3J16/94-0013R2.  Rewritten by Nathan Myers to ISO-14882.
+// Non-reference-counted implementation written by Paolo Carlini and
+// updated by Jonathan Wakely for ISO-14882-2011.
+
+#ifndef _BASIC_STRING_TCC
+#define _BASIC_STRING_TCC 1
+
+#pragma GCC system_header
+
+#include <bits/cxxabi_forced.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#if _GLIBCXX_USE_CXX11_ABI
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::npos;
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    swap(basic_string& __s) _GLIBCXX_NOEXCEPT
+    {
+      if (this == &__s)
+	return;
+
+      _Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator());
+
+      if (_M_is_local())
+	if (__s._M_is_local())
+	  {
+	    if (length() && __s.length())
+	      {
+		_CharT __tmp_data[_S_local_capacity + 1];
+		traits_type::copy(__tmp_data, __s._M_local_buf,
+				  _S_local_capacity + 1);
+		traits_type::copy(__s._M_local_buf, _M_local_buf,
+				  _S_local_capacity + 1);
+		traits_type::copy(_M_local_buf, __tmp_data,
+				  _S_local_capacity + 1);
+	      }
+	    else if (__s.length())
+	      {
+		traits_type::copy(_M_local_buf, __s._M_local_buf,
+				  _S_local_capacity + 1);
+		_M_length(__s.length());
+		__s._M_set_length(0);
+		return;
+	      }
+	    else if (length())
+	      {
+		traits_type::copy(__s._M_local_buf, _M_local_buf,
+				  _S_local_capacity + 1);
+		__s._M_length(length());
+		_M_set_length(0);
+		return;
+	      }
+	  }
+	else
+	  {
+	    const size_type __tmp_capacity = __s._M_allocated_capacity;
+	    traits_type::copy(__s._M_local_buf, _M_local_buf,
+			      _S_local_capacity + 1);
+	    _M_data(__s._M_data());
+	    __s._M_data(__s._M_local_buf);
+	    _M_capacity(__tmp_capacity);
+	  }
+      else
+	{
+	  const size_type __tmp_capacity = _M_allocated_capacity;
+	  if (__s._M_is_local())
+	    {
+	      traits_type::copy(_M_local_buf, __s._M_local_buf,
+				_S_local_capacity + 1);
+	      __s._M_data(_M_data());
+	      _M_data(_M_local_buf);
+	    }
+	  else
+	    {
+	      pointer __tmp_ptr = _M_data();
+	      _M_data(__s._M_data());
+	      __s._M_data(__tmp_ptr);
+	      _M_capacity(__s._M_allocated_capacity);
+	    }
+	  __s._M_capacity(__tmp_capacity);
+	}
+
+      const size_type __tmp_length = length();
+      _M_length(__s.length());
+      __s._M_length(__tmp_length);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::pointer
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_create(size_type& __capacity, size_type __old_capacity)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 83.  String::npos vs. string::max_size()
+      if (__capacity > max_size())
+	std::__throw_length_error(__N("basic_string::_M_create"));
+
+      // The below implements an exponential growth policy, necessary to
+      // meet amortized linear time requirements of the library: see
+      // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+      if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+	{
+	  __capacity = 2 * __old_capacity;
+	  // Never allocate a string bigger than max_size.
+	  if (__capacity > max_size())
+	    __capacity = max_size();
+	}
+
+      // NB: Need an array of char_type[__capacity], plus a terminating
+      // null char_type() element.
+      return _Alloc_traits::allocate(_M_get_allocator(), __capacity + 1);
+    }
+
+  // NB: This is the special case for Input Iterators, used in
+  // istreambuf_iterators, etc.
+  // Input Iterators have a cost structure very different from
+  // pointers, calling for a different coding style.
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      void
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_construct(_InIterator __beg, _InIterator __end,
+		   std::input_iterator_tag)
+      {
+	size_type __len = 0;
+	size_type __capacity = size_type(_S_local_capacity);
+
+	while (__beg != __end && __len < __capacity)
+	  {
+	    _M_data()[__len++] = *__beg;
+	    ++__beg;
+	  }
+
+	__try
+	  {
+	    while (__beg != __end)
+	      {
+		if (__len == __capacity)
+		  {
+		    // Allocate more space.
+		    __capacity = __len + 1;
+		    pointer __another = _M_create(__capacity, __len);
+		    this->_S_copy(__another, _M_data(), __len);
+		    _M_dispose();
+		    _M_data(__another);
+		    _M_capacity(__capacity);
+		  }
+		_M_data()[__len++] = *__beg;
+		++__beg;
+	      }
+	  }
+	__catch(...)
+	  {
+	    _M_dispose();
+	    __throw_exception_again;
+	  }
+
+	_M_set_length(__len);
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      void
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_construct(_InIterator __beg, _InIterator __end,
+		   std::forward_iterator_tag)
+      {
+	// NB: Not required, but considered best practice.
+	if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
+	  std::__throw_logic_error(__N("basic_string::"
+				       "_M_construct null not valid"));
+
+	size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
+
+	if (__dnew > size_type(_S_local_capacity))
+	  {
+	    _M_data(_M_create(__dnew, size_type(0)));
+	    _M_capacity(__dnew);
+	  }
+
+	// Check for out_of_range and length_error exceptions.
+	__try
+	  { this->_S_copy_chars(_M_data(), __beg, __end); }
+	__catch(...)
+	  {
+	    _M_dispose();
+	    __throw_exception_again;
+	  }
+
+	_M_set_length(__dnew);
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_construct(size_type __n, _CharT __c)
+    {
+      if (__n > size_type(_S_local_capacity))
+	{
+	  _M_data(_M_create(__n, size_type(0)));
+	  _M_capacity(__n);
+	}
+
+      if (__n)
+	this->_S_assign(_M_data(), __n, __c);
+
+      _M_set_length(__n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_assign(const basic_string& __str)
+    {
+      if (this != &__str)
+	{
+	  const size_type __rsize = __str.length();
+	  const size_type __capacity = capacity();
+
+	  if (__rsize > __capacity)
+	    {
+	      size_type __new_capacity = __rsize;
+	      pointer __tmp = _M_create(__new_capacity, __capacity);
+	      _M_dispose();
+	      _M_data(__tmp);
+	      _M_capacity(__new_capacity);
+	    }
+
+	  if (__rsize)
+	    this->_S_copy(_M_data(), __str._M_data(), __rsize);
+
+	  _M_set_length(__rsize);
+	}
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    reserve(size_type __res)
+    {
+      // Make sure we don't shrink below the current size.
+      if (__res < length())
+	__res = length();
+
+      const size_type __capacity = capacity();
+      if (__res != __capacity)
+	{
+	  if (__res > __capacity
+	      || __res > size_type(_S_local_capacity))
+	    {
+	      pointer __tmp = _M_create(__res, __capacity);
+	      this->_S_copy(__tmp, _M_data(), length() + 1);
+	      _M_dispose();
+	      _M_data(__tmp);
+	      _M_capacity(__res);
+	    }
+	  else if (!_M_is_local())
+	    {
+	      this->_S_copy(_M_local_data(), _M_data(), length() + 1);
+	      _M_destroy(__capacity);
+	      _M_data(_M_local_data());
+	    }
+	}
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+	      size_type __len2)
+    {
+      const size_type __how_much = length() - __pos - __len1;
+
+      size_type __new_capacity = length() + __len2 - __len1;
+      pointer __r = _M_create(__new_capacity, capacity());
+
+      if (__pos)
+	this->_S_copy(__r, _M_data(), __pos);
+      if (__s && __len2)
+	this->_S_copy(__r + __pos, __s, __len2);
+      if (__how_much)
+	this->_S_copy(__r + __pos + __len2,
+		      _M_data() + __pos + __len1, __how_much);
+
+      _M_dispose();
+      _M_data(__r);
+      _M_capacity(__new_capacity);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_erase(size_type __pos, size_type __n)
+    {
+      const size_type __how_much = length() - __pos - __n;
+
+      if (__how_much && __n)
+	this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
+
+      _M_set_length(length() - __n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    resize(size_type __n, _CharT __c)
+    {
+      const size_type __size = this->size();
+      if (__size < __n)
+	this->append(__n - __size, __c);
+      else if (__n < __size)
+	this->_M_set_length(__n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_append(const _CharT* __s, size_type __n)
+    {
+      const size_type __len = __n + this->size();
+
+      if (__len <= this->capacity())
+	{
+	  if (__n)
+	    this->_S_copy(this->_M_data() + this->size(), __s, __n);
+	}
+      else
+	this->_M_mutate(this->size(), size_type(0), __s, __n);
+
+      this->_M_set_length(__len);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InputIterator>
+      basic_string<_CharT, _Traits, _Alloc>&
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+			  _InputIterator __k1, _InputIterator __k2,
+			  std::__false_type)
+      {
+	const basic_string __s(__k1, __k2);
+	const size_type __n1 = __i2 - __i1;
+	return _M_replace(__i1 - begin(), __n1, __s._M_data(),
+			  __s.size());
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+		   _CharT __c)
+    {
+      _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __n2 - __n1;
+
+      if (__new_size <= this->capacity())
+	{
+	  pointer __p = this->_M_data() + __pos1;
+
+	  const size_type __how_much = __old_size - __pos1 - __n1;
+	  if (__how_much && __n1 != __n2)
+	    this->_S_move(__p + __n2, __p + __n1, __how_much);
+	}
+      else
+	this->_M_mutate(__pos1, __n1, 0, __n2);
+
+      if (__n2)
+	this->_S_assign(this->_M_data() + __pos1, __n2, __c);
+
+      this->_M_set_length(__new_size);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+	       const size_type __len2)
+    {
+      _M_check_length(__len1, __len2, "basic_string::_M_replace");
+
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __len2 - __len1;
+
+      if (__new_size <= this->capacity())
+	{
+	  pointer __p = this->_M_data() + __pos;
+
+	  const size_type __how_much = __old_size - __pos - __len1;
+	  if (_M_disjunct(__s))
+	    {
+	      if (__how_much && __len1 != __len2)
+		this->_S_move(__p + __len2, __p + __len1, __how_much);
+	      if (__len2)
+		this->_S_copy(__p, __s, __len2);
+	    }
+	  else
+	    {
+	      // Work in-place.
+	      if (__len2 && __len2 <= __len1)
+		this->_S_move(__p, __s, __len2);
+	      if (__how_much && __len1 != __len2)
+		this->_S_move(__p + __len2, __p + __len1, __how_much);
+	      if (__len2 > __len1)
+		{
+		  if (__s + __len2 <= __p + __len1)
+		    this->_S_move(__p, __s, __len2);
+		  else if (__s >= __p + __len1)
+		    this->_S_copy(__p, __s + __len2 - __len1, __len2);
+		  else
+		    {
+		      const size_type __nleft = (__p + __len1) - __s;
+		      this->_S_move(__p, __s, __nleft);
+		      this->_S_copy(__p + __nleft, __p + __len2,
+				    __len2 - __nleft);
+		    }
+		}
+	    }
+	}
+      else
+	this->_M_mutate(__pos, __len1, __s, __len2);
+
+      this->_M_set_length(__new_size);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    copy(_CharT* __s, size_type __n, size_type __pos) const
+    {
+      _M_check(__pos, "basic_string::copy");
+      __n = _M_limit(__pos, __n);
+      __glibcxx_requires_string_len(__s, __n);
+      if (__n)
+	_S_copy(__s, _M_data() + __pos, __n);
+      // 21.3.5.7 par 3: do not append null.  (good.)
+      return __n;
+    }
+
+#else  // !_GLIBCXX_USE_CXX11_ABI
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    const _CharT
+    basic_string<_CharT, _Traits, _Alloc>::
+    _Rep::_S_terminal = _CharT();
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::npos;
+
+  // Linker sets _S_empty_rep_storage to all 0s (one reference, empty string)
+  // at static init time (before static ctors are run).
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
+    (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
+      sizeof(size_type)];
+
+  // NB: This is the special case for Input Iterators, used in
+  // istreambuf_iterators, etc.
+  // Input Iterators have a cost structure very different from
+  // pointers, calling for a different coding style.
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      _CharT*
+      basic_string<_CharT, _Traits, _Alloc>::
+      _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+		   input_iterator_tag)
+      {
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+	if (__beg == __end && __a == _Alloc())
+	  return _S_empty_rep()._M_refdata();
+#endif
+	// Avoid reallocation for common case.
+	_CharT __buf[128];
+	size_type __len = 0;
+	while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
+	  {
+	    __buf[__len++] = *__beg;
+	    ++__beg;
+	  }
+	_Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
+	_M_copy(__r->_M_refdata(), __buf, __len);
+	__try
+	  {
+	    while (__beg != __end)
+	      {
+		if (__len == __r->_M_capacity)
+		  {
+		    // Allocate more space.
+		    _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
+		    _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
+		    __r->_M_destroy(__a);
+		    __r = __another;
+		  }
+		__r->_M_refdata()[__len++] = *__beg;
+		++__beg;
+	      }
+	  }
+	__catch(...)
+	  {
+	    __r->_M_destroy(__a);
+	    __throw_exception_again;
+	  }
+	__r->_M_set_length_and_sharable(__len);
+	return __r->_M_refdata();
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template <typename _InIterator>
+      _CharT*
+      basic_string<_CharT, _Traits, _Alloc>::
+      _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+		   forward_iterator_tag)
+      {
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+	if (__beg == __end && __a == _Alloc())
+	  return _S_empty_rep()._M_refdata();
+#endif
+	// NB: Not required, but considered best practice.
+	if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
+	  __throw_logic_error(__N("basic_string::_S_construct null not valid"));
+
+	const size_type __dnew = static_cast<size_type>(std::distance(__beg,
+								      __end));
+	// Check for out_of_range and length_error exceptions.
+	_Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
+	__try
+	  { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+	__catch(...)
+	  {
+	    __r->_M_destroy(__a);
+	    __throw_exception_again;
+	  }
+	__r->_M_set_length_and_sharable(__dnew);
+	return __r->_M_refdata();
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    _CharT*
+    basic_string<_CharT, _Traits, _Alloc>::
+    _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
+    {
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+      if (__n == 0 && __a == _Alloc())
+	return _S_empty_rep()._M_refdata();
+#endif
+      // Check for out_of_range and length_error exceptions.
+      _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
+      if (__n)
+	_M_assign(__r->_M_refdata(), __n, __c);
+
+      __r->_M_set_length_and_sharable(__n);
+      return __r->_M_refdata();
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const basic_string& __str)
+    : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
+					  __str.get_allocator()),
+		  __str.get_allocator())
+    { }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const _Alloc& __a)
+    : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
+    { }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const basic_string& __str, size_type __pos, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__str._M_data()
+			       + __str._M_check(__pos,
+						"basic_string::basic_string"),
+			       __str._M_data() + __str._M_limit(__pos, npos)
+			       + __pos, __a), __a)
+    { }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const basic_string& __str, size_type __pos, size_type __n)
+    : _M_dataplus(_S_construct(__str._M_data()
+			       + __str._M_check(__pos,
+						"basic_string::basic_string"),
+			       __str._M_data() + __str._M_limit(__pos, __n)
+			       + __pos, _Alloc()), _Alloc())
+    { }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const basic_string& __str, size_type __pos,
+		 size_type __n, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__str._M_data()
+			       + __str._M_check(__pos,
+						"basic_string::basic_string"),
+			       __str._M_data() + __str._M_limit(__pos, __n)
+			       + __pos, __a), __a)
+    { }
+
+  // TBD: DPG annotate
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
+    { }
+
+  // TBD: DPG annotate
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(const _CharT* __s, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
+			       __s + npos, __a), __a)
+    { }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(size_type __n, _CharT __c, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__n, __c, __a), __a)
+    { }
+
+  // TBD: DPG annotate
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InputIterator>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__beg, __end, __a), __a)
+    { }
+
+#if __cplusplus >= 201103L
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>::
+    basic_string(initializer_list<_CharT> __l, const _Alloc& __a)
+    : _M_dataplus(_S_construct(__l.begin(), __l.end(), __a), __a)
+    { }
+#endif
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    assign(const basic_string& __str)
+    {
+      if (_M_rep() != __str._M_rep())
+	{
+	  // XXX MT
+	  const allocator_type __a = this->get_allocator();
+	  _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
+	  _M_rep()->_M_dispose(__a);
+	  _M_data(__tmp);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    assign(const _CharT* __s, size_type __n)
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      _M_check_length(this->size(), __n, "basic_string::assign");
+      if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+	return _M_replace_safe(size_type(0), this->size(), __s, __n);
+      else
+	{
+	  // Work in-place.
+	  const size_type __pos = __s - _M_data();
+	  if (__pos >= __n)
+	    _M_copy(_M_data(), __s, __n);
+	  else if (__pos)
+	    _M_move(_M_data(), __s, __n);
+	  _M_rep()->_M_set_length_and_sharable(__n);
+	  return *this;
+	}
+     }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    append(size_type __n, _CharT __c)
+    {
+      if (__n)
+	{
+	  _M_check_length(size_type(0), __n, "basic_string::append");	  
+	  const size_type __len = __n + this->size();
+	  if (__len > this->capacity() || _M_rep()->_M_is_shared())
+	    this->reserve(__len);
+	  _M_assign(_M_data() + this->size(), __n, __c);
+	  _M_rep()->_M_set_length_and_sharable(__len);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    append(const _CharT* __s, size_type __n)
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      if (__n)
+	{
+	  _M_check_length(size_type(0), __n, "basic_string::append");
+	  const size_type __len = __n + this->size();
+	  if (__len > this->capacity() || _M_rep()->_M_is_shared())
+	    {
+	      if (_M_disjunct(__s))
+		this->reserve(__len);
+	      else
+		{
+		  const size_type __off = __s - _M_data();
+		  this->reserve(__len);
+		  __s = _M_data() + __off;
+		}
+	    }
+	  _M_copy(_M_data() + this->size(), __s, __n);
+	  _M_rep()->_M_set_length_and_sharable(__len);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    append(const basic_string& __str)
+    {
+      const size_type __size = __str.size();
+      if (__size)
+	{
+	  const size_type __len = __size + this->size();
+	  if (__len > this->capacity() || _M_rep()->_M_is_shared())
+	    this->reserve(__len);
+	  _M_copy(_M_data() + this->size(), __str._M_data(), __size);
+	  _M_rep()->_M_set_length_and_sharable(__len);
+	}
+      return *this;
+    }    
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    append(const basic_string& __str, size_type __pos, size_type __n)
+    {
+      __str._M_check(__pos, "basic_string::append");
+      __n = __str._M_limit(__pos, __n);
+      if (__n)
+	{
+	  const size_type __len = __n + this->size();
+	  if (__len > this->capacity() || _M_rep()->_M_is_shared())
+	    this->reserve(__len);
+	  _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
+	  _M_rep()->_M_set_length_and_sharable(__len);	  
+	}
+      return *this;
+    }
+
+   template<typename _CharT, typename _Traits, typename _Alloc>
+     basic_string<_CharT, _Traits, _Alloc>&
+     basic_string<_CharT, _Traits, _Alloc>::
+     insert(size_type __pos, const _CharT* __s, size_type __n)
+     {
+       __glibcxx_requires_string_len(__s, __n);
+       _M_check(__pos, "basic_string::insert");
+       _M_check_length(size_type(0), __n, "basic_string::insert");
+       if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+         return _M_replace_safe(__pos, size_type(0), __s, __n);
+       else
+         {
+           // Work in-place.
+           const size_type __off = __s - _M_data();
+           _M_mutate(__pos, 0, __n);
+           __s = _M_data() + __off;
+           _CharT* __p = _M_data() + __pos;
+           if (__s  + __n <= __p)
+             _M_copy(__p, __s, __n);
+           else if (__s >= __p)
+             _M_copy(__p, __s + __n, __n);
+           else
+             {
+	       const size_type __nleft = __p - __s;
+               _M_copy(__p, __s, __nleft);
+               _M_copy(__p + __nleft, __p + __n, __n - __nleft);
+             }
+           return *this;
+         }
+     }
+
+   template<typename _CharT, typename _Traits, typename _Alloc>
+     typename basic_string<_CharT, _Traits, _Alloc>::iterator
+     basic_string<_CharT, _Traits, _Alloc>::
+     erase(iterator __first, iterator __last)
+     {
+       _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
+				&& __last <= _M_iend());
+
+       // NB: This isn't just an optimization (bail out early when
+       // there is nothing to do, really), it's also a correctness
+       // issue vs MT, see libstdc++/40518.
+       const size_type __size = __last - __first;
+       if (__size)
+	 {
+	   const size_type __pos = __first - _M_ibegin();
+	   _M_mutate(__pos, __size, size_type(0));
+	   _M_rep()->_M_set_leaked();
+	   return iterator(_M_data() + __pos);
+	 }
+       else
+	 return __first;
+     }
+
+   template<typename _CharT, typename _Traits, typename _Alloc>
+     basic_string<_CharT, _Traits, _Alloc>&
+     basic_string<_CharT, _Traits, _Alloc>::
+     replace(size_type __pos, size_type __n1, const _CharT* __s,
+	     size_type __n2)
+     {
+       __glibcxx_requires_string_len(__s, __n2);
+       _M_check(__pos, "basic_string::replace");
+       __n1 = _M_limit(__pos, __n1);
+       _M_check_length(__n1, __n2, "basic_string::replace");
+       bool __left;
+       if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+         return _M_replace_safe(__pos, __n1, __s, __n2);
+       else if ((__left = __s + __n2 <= _M_data() + __pos)
+		|| _M_data() + __pos + __n1 <= __s)
+	 {
+	   // Work in-place: non-overlapping case.
+	   size_type __off = __s - _M_data();
+	   __left ? __off : (__off += __n2 - __n1);
+	   _M_mutate(__pos, __n1, __n2);
+	   _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
+	   return *this;
+	 }
+       else
+	 {
+	   // Todo: overlapping case.
+	   const basic_string __tmp(__s, __n2);
+	   return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
+	 }
+     }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::_Rep::
+    _M_destroy(const _Alloc& __a) throw ()
+    {
+      const size_type __size = sizeof(_Rep_base) +
+	                       (this->_M_capacity + 1) * sizeof(_CharT);
+      _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_leak_hard()
+    {
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+      if (_M_rep() == &_S_empty_rep())
+	return;
+#endif
+      if (_M_rep()->_M_is_shared())
+	_M_mutate(0, 0, 0);
+      _M_rep()->_M_set_leaked();
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_mutate(size_type __pos, size_type __len1, size_type __len2)
+    {
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __len2 - __len1;
+      const size_type __how_much = __old_size - __pos - __len1;
+
+      if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
+	{
+	  // Must reallocate.
+	  const allocator_type __a = get_allocator();
+	  _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
+
+	  if (__pos)
+	    _M_copy(__r->_M_refdata(), _M_data(), __pos);
+	  if (__how_much)
+	    _M_copy(__r->_M_refdata() + __pos + __len2,
+		    _M_data() + __pos + __len1, __how_much);
+
+	  _M_rep()->_M_dispose(__a);
+	  _M_data(__r->_M_refdata());
+	}
+      else if (__how_much && __len1 != __len2)
+	{
+	  // Work in-place.
+	  _M_move(_M_data() + __pos + __len2,
+		  _M_data() + __pos + __len1, __how_much);
+	}
+      _M_rep()->_M_set_length_and_sharable(__new_size);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    reserve(size_type __res)
+    {
+      if (__res != this->capacity() || _M_rep()->_M_is_shared())
+        {
+	  // Make sure we don't shrink below the current size
+	  if (__res < this->size())
+	    __res = this->size();
+	  const allocator_type __a = get_allocator();
+	  _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
+	  _M_rep()->_M_dispose(__a);
+	  _M_data(__tmp);
+        }
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    swap(basic_string& __s)
+    {
+      if (_M_rep()->_M_is_leaked())
+	_M_rep()->_M_set_sharable();
+      if (__s._M_rep()->_M_is_leaked())
+	__s._M_rep()->_M_set_sharable();
+      if (this->get_allocator() == __s.get_allocator())
+	{
+	  _CharT* __tmp = _M_data();
+	  _M_data(__s._M_data());
+	  __s._M_data(__tmp);
+	}
+      // The code below can usually be optimized away.
+      else
+	{
+	  const basic_string __tmp1(_M_ibegin(), _M_iend(),
+				    __s.get_allocator());
+	  const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
+				    this->get_allocator());
+	  *this = __tmp2;
+	  __s = __tmp1;
+	}
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
+    basic_string<_CharT, _Traits, _Alloc>::_Rep::
+    _S_create(size_type __capacity, size_type __old_capacity,
+	      const _Alloc& __alloc)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 83.  String::npos vs. string::max_size()
+      if (__capacity > _S_max_size)
+	__throw_length_error(__N("basic_string::_S_create"));
+
+      // The standard places no restriction on allocating more memory
+      // than is strictly needed within this layer at the moment or as
+      // requested by an explicit application call to reserve().
+
+      // Many malloc implementations perform quite poorly when an
+      // application attempts to allocate memory in a stepwise fashion
+      // growing each allocation size by only 1 char.  Additionally,
+      // it makes little sense to allocate less linear memory than the
+      // natural blocking size of the malloc implementation.
+      // Unfortunately, we would need a somewhat low-level calculation
+      // with tuned parameters to get this perfect for any particular
+      // malloc implementation.  Fortunately, generalizations about
+      // common features seen among implementations seems to suffice.
+
+      // __pagesize need not match the actual VM page size for good
+      // results in practice, thus we pick a common value on the low
+      // side.  __malloc_header_size is an estimate of the amount of
+      // overhead per memory allocation (in practice seen N * sizeof
+      // (void*) where N is 0, 2 or 4).  According to folklore,
+      // picking this value on the high side is better than
+      // low-balling it (especially when this algorithm is used with
+      // malloc implementations that allocate memory blocks rounded up
+      // to a size which is a power of 2).
+      const size_type __pagesize = 4096;
+      const size_type __malloc_header_size = 4 * sizeof(void*);
+
+      // The below implements an exponential growth policy, necessary to
+      // meet amortized linear time requirements of the library: see
+      // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+      // It's active for allocations requiring an amount of memory above
+      // system pagesize. This is consistent with the requirements of the
+      // standard: http://gcc.gnu.org/ml/libstdc++/2001-07/msg00130.html
+      if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+	__capacity = 2 * __old_capacity;
+
+      // NB: Need an array of char_type[__capacity], plus a terminating
+      // null char_type() element, plus enough for the _Rep data structure.
+      // Whew. Seemingly so needy, yet so elemental.
+      size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+
+      const size_type __adj_size = __size + __malloc_header_size;
+      if (__adj_size > __pagesize && __capacity > __old_capacity)
+	{
+	  const size_type __extra = __pagesize - __adj_size % __pagesize;
+	  __capacity += __extra / sizeof(_CharT);
+	  // Never allocate a string bigger than _S_max_size.
+	  if (__capacity > _S_max_size)
+	    __capacity = _S_max_size;
+	  __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+	}
+
+      // NB: Might throw, but no worries about a leak, mate: _Rep()
+      // does not throw.
+      void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
+      _Rep *__p = new (__place) _Rep;
+      __p->_M_capacity = __capacity;
+      // ABI compatibility - 3.4.x set in _S_create both
+      // _M_refcount and _M_length.  All callers of _S_create
+      // in basic_string.tcc then set just _M_length.
+      // In 4.0.x and later both _M_refcount and _M_length
+      // are initialized in the callers, unfortunately we can
+      // have 3.4.x compiled code with _S_create callers inlined
+      // calling 4.0.x+ _S_create.
+      __p->_M_set_sharable();
+      return __p;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    _CharT*
+    basic_string<_CharT, _Traits, _Alloc>::_Rep::
+    _M_clone(const _Alloc& __alloc, size_type __res)
+    {
+      // Requested capacity of the clone.
+      const size_type __requested_cap = this->_M_length + __res;
+      _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
+				  __alloc);
+      if (this->_M_length)
+	_M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
+
+      __r->_M_set_length_and_sharable(this->_M_length);
+      return __r->_M_refdata();
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    resize(size_type __n, _CharT __c)
+    {
+      const size_type __size = this->size();
+      _M_check_length(__size, __n, "basic_string::resize");
+      if (__size < __n)
+	this->append(__n - __size, __c);
+      else if (__n < __size)
+	this->erase(__n);
+      // else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InputIterator>
+      basic_string<_CharT, _Traits, _Alloc>&
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+			  _InputIterator __k2, __false_type)
+      {
+	const basic_string __s(__k1, __k2);
+	const size_type __n1 = __i2 - __i1;
+	_M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
+	return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
+			       __s.size());
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+		   _CharT __c)
+    {
+      _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+      _M_mutate(__pos1, __n1, __n2);
+      if (__n2)
+	_M_assign(_M_data() + __pos1, __n2, __c);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+		    size_type __n2)
+    {
+      _M_mutate(__pos1, __n1, __n2);
+      if (__n2)
+	_M_copy(_M_data() + __pos1, __s, __n2);
+      return *this;
+    }
+
+    template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    copy(_CharT* __s, size_type __n, size_type __pos) const
+    {
+      _M_check(__pos, "basic_string::copy");
+      __n = _M_limit(__pos, __n);
+      __glibcxx_requires_string_len(__s, __n);
+      if (__n)
+	_M_copy(__s, _M_data() + __pos, __n);
+      // 21.3.5.7 par 3: do not append null.  (good.)
+      return __n;
+    }
+#endif  // !_GLIBCXX_USE_CXX11_ABI
+   
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(const _CharT* __lhs,
+	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      __glibcxx_requires_string(__lhs);
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type	  __size_type;
+      const __size_type __len = _Traits::length(__lhs);
+      __string_type __str;
+      __str.reserve(__len + __rhs.size());
+      __str.append(__lhs, __len);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type	  __size_type;
+      __string_type __str;
+      const __size_type __len = __rhs.size();
+      __str.reserve(__len + 1);
+      __str.append(__size_type(1), __lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find(const _CharT* __s, size_type __pos, size_type __n) const
+    _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      const size_type __size = this->size();
+
+      if (__n == 0)
+	return __pos <= __size ? __pos : npos;
+      if (__pos >= __size)
+	return npos;
+
+      const _CharT __elem0 = __s[0];
+      const _CharT* const __data = data();
+      const _CharT* __first = __data + __pos;
+      const _CharT* const __last = __data + __size;
+      size_type __len = __size - __pos;
+
+      while (__len >= __n)
+	{
+	  // Find the first occurrence of __elem0:
+	  __first = traits_type::find(__first, __len - __n + 1, __elem0);
+	  if (!__first)
+	    return npos;
+	  // Compare the full strings from the first occurrence of __elem0.
+	  // We already know that __first[0] == __s[0] but compare them again
+	  // anyway because __s is probably aligned, which helps memcmp.
+	  if (traits_type::compare(__first, __s, __n) == 0)
+	    return __first - __data;
+	  __len = __last - ++__first;
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT
+    {
+      size_type __ret = npos;
+      const size_type __size = this->size();
+      if (__pos < __size)
+	{
+	  const _CharT* __data = _M_data();
+	  const size_type __n = __size - __pos;
+	  const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+	  if (__p)
+	    __ret = __p - __data;
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    rfind(const _CharT* __s, size_type __pos, size_type __n) const
+    _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      const size_type __size = this->size();
+      if (__n <= __size)
+	{
+	  __pos = std::min(size_type(__size - __n), __pos);
+	  const _CharT* __data = _M_data();
+	  do
+	    {
+	      if (traits_type::compare(__data + __pos, __s, __n) == 0)
+		return __pos;
+	    }
+	  while (__pos-- > 0);
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    rfind(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT
+    {
+      size_type __size = this->size();
+      if (__size)
+	{
+	  if (--__size > __pos)
+	    __size = __pos;
+	  for (++__size; __size-- > 0; )
+	    if (traits_type::eq(_M_data()[__size], __c))
+	      return __size;
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+    _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      for (; __n && __pos < this->size(); ++__pos)
+	{
+	  const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
+	  if (__p)
+	    return __pos;
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+    _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      size_type __size = this->size();
+      if (__size && __n)
+	{
+	  if (--__size > __pos)
+	    __size = __pos;
+	  do
+	    {
+	      if (traits_type::find(__s, __n, _M_data()[__size]))
+		return __size;
+	    }
+	  while (__size-- != 0);
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      for (; __pos < this->size(); ++__pos)
+	if (!traits_type::find(__s, __n, _M_data()[__pos]))
+	  return __pos;
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_not_of(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT
+    {
+      for (; __pos < this->size(); ++__pos)
+	if (!traits_type::eq(_M_data()[__pos], __c))
+	  return __pos;
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string_len(__s, __n);
+      size_type __size = this->size();
+      if (__size)
+	{
+	  if (--__size > __pos)
+	    __size = __pos;
+	  do
+	    {
+	      if (!traits_type::find(__s, __n, _M_data()[__size]))
+		return __size;
+	    }
+	  while (__size--);
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_not_of(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT
+    {
+      size_type __size = this->size();
+      if (__size)
+	{
+	  if (--__size > __pos)
+	    __size = __pos;
+	  do
+	    {
+	      if (!traits_type::eq(_M_data()[__size], __c))
+		return __size;
+	    }
+	  while (__size--);
+	}
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n, const basic_string& __str) const
+    {
+      _M_check(__pos, "basic_string::compare");
+      __n = _M_limit(__pos, __n);
+      const size_type __osize = __str.size();
+      const size_type __len = std::min(__n, __osize);
+      int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
+      if (!__r)
+	__r = _S_compare(__n, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(size_type __pos1, size_type __n1, const basic_string& __str,
+	    size_type __pos2, size_type __n2) const
+    {
+      _M_check(__pos1, "basic_string::compare");
+      __str._M_check(__pos2, "basic_string::compare");
+      __n1 = _M_limit(__pos1, __n1);
+      __n2 = __str._M_limit(__pos2, __n2);
+      const size_type __len = std::min(__n1, __n2);
+      int __r = traits_type::compare(_M_data() + __pos1,
+				     __str.data() + __pos2, __len);
+      if (!__r)
+	__r = _S_compare(__n1, __n2);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT
+    {
+      __glibcxx_requires_string(__s);
+      const size_type __size = this->size();
+      const size_type __osize = traits_type::length(__s);
+      const size_type __len = std::min(__size, __osize);
+      int __r = traits_type::compare(_M_data(), __s, __len);
+      if (!__r)
+	__r = _S_compare(__size, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string <_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n1, const _CharT* __s) const
+    {
+      __glibcxx_requires_string(__s);
+      _M_check(__pos, "basic_string::compare");
+      __n1 = _M_limit(__pos, __n1);
+      const size_type __osize = traits_type::length(__s);
+      const size_type __len = std::min(__n1, __osize);
+      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+      if (!__r)
+	__r = _S_compare(__n1, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string <_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n1, const _CharT* __s,
+	    size_type __n2) const
+    {
+      __glibcxx_requires_string_len(__s, __n2);
+      _M_check(__pos, "basic_string::compare");
+      __n1 = _M_limit(__pos, __n1);
+      const size_type __len = std::min(__n1, __n2);
+      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+      if (!__r)
+	__r = _S_compare(__n1, __n2);
+      return __r;
+    }
+
+  // 21.3.7.9 basic_string::getline and operators
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in,
+	       basic_string<_CharT, _Traits, _Alloc>& __str)
+    {
+      typedef basic_istream<_CharT, _Traits>		__istream_type;
+      typedef basic_string<_CharT, _Traits, _Alloc>	__string_type;
+      typedef typename __istream_type::ios_base         __ios_base;
+      typedef typename __istream_type::int_type		__int_type;
+      typedef typename __string_type::size_type		__size_type;
+      typedef ctype<_CharT>				__ctype_type;
+      typedef typename __ctype_type::ctype_base         __ctype_base;
+
+      __size_type __extracted = 0;
+      typename __ios_base::iostate __err = __ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      // Avoid reallocation for common case.
+	      __str.erase();
+	      _CharT __buf[128];
+	      __size_type __len = 0;	      
+	      const streamsize __w = __in.width();
+	      const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+		                              : __str.max_size();
+	      const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+	      const __int_type __eof = _Traits::eof();
+	      __int_type __c = __in.rdbuf()->sgetc();
+
+	      while (__extracted < __n
+		     && !_Traits::eq_int_type(__c, __eof)
+		     && !__ct.is(__ctype_base::space,
+				 _Traits::to_char_type(__c)))
+		{
+		  if (__len == sizeof(__buf) / sizeof(_CharT))
+		    {
+		      __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+		      __len = 0;
+		    }
+		  __buf[__len++] = _Traits::to_char_type(__c);
+		  ++__extracted;
+		  __c = __in.rdbuf()->snextc();
+		}
+	      __str.append(__buf, __len);
+
+	      if (_Traits::eq_int_type(__c, __eof))
+		__err |= __ios_base::eofbit;
+	      __in.width(0);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      __in._M_setstate(__ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    {
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 91. Description of operator>> and getline() for string<>
+	      // might cause endless loop
+	      __in._M_setstate(__ios_base::badbit);
+	    }
+	}
+      // 211.  operator>>(istream&, string&) doesn't set failbit
+      if (!__extracted)
+	__err |= __ios_base::failbit;
+      if (__err)
+	__in.setstate(__err);
+      return __in;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __in,
+	    basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+    {
+      typedef basic_istream<_CharT, _Traits>		__istream_type;
+      typedef basic_string<_CharT, _Traits, _Alloc>	__string_type;
+      typedef typename __istream_type::ios_base         __ios_base;
+      typedef typename __istream_type::int_type		__int_type;
+      typedef typename __string_type::size_type		__size_type;
+
+      __size_type __extracted = 0;
+      const __size_type __n = __str.max_size();
+      typename __ios_base::iostate __err = __ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, true);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      __str.erase();
+	      const __int_type __idelim = _Traits::to_int_type(__delim);
+	      const __int_type __eof = _Traits::eof();
+	      __int_type __c = __in.rdbuf()->sgetc();
+
+	      while (__extracted < __n
+		     && !_Traits::eq_int_type(__c, __eof)
+		     && !_Traits::eq_int_type(__c, __idelim))
+		{
+		  __str += _Traits::to_char_type(__c);
+		  ++__extracted;
+		  __c = __in.rdbuf()->snextc();
+		}
+
+	      if (_Traits::eq_int_type(__c, __eof))
+		__err |= __ios_base::eofbit;
+	      else if (_Traits::eq_int_type(__c, __idelim))
+		{
+		  ++__extracted;		  
+		  __in.rdbuf()->sbumpc();
+		}
+	      else
+		__err |= __ios_base::failbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      __in._M_setstate(__ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    {
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 91. Description of operator>> and getline() for string<>
+	      // might cause endless loop
+	      __in._M_setstate(__ios_base::badbit);
+	    }
+	}
+      if (!__extracted)
+	__err |= __ios_base::failbit;
+      if (__err)
+	__in.setstate(__err);
+      return __in;
+    }
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  // The explicit instantiations definitions in src/c++11/string-inst.cc
+  // are compiled as C++14, so the new C++17 members aren't instantiated.
+  // Until those definitions are compiled as C++17 suppress the declaration,
+  // so C++17 code will implicitly instantiate std::string and std::wstring
+  // as needed.
+# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0
+  extern template class basic_string<char>;
+# elif ! _GLIBCXX_USE_CXX11_ABI
+  // Still need to prevent implicit instantiation of the COW empty rep,
+  // to ensure the definition in libstdc++.so is unique (PR 86138).
+  extern template basic_string<char>::size_type
+    basic_string<char>::_Rep::_S_empty_rep_storage[];
+# endif
+
+  extern template
+    basic_istream<char>&
+    operator>>(basic_istream<char>&, string&);
+  extern template
+    basic_ostream<char>&
+    operator<<(basic_ostream<char>&, const string&);
+  extern template
+    basic_istream<char>&
+    getline(basic_istream<char>&, string&, char);
+  extern template
+    basic_istream<char>&
+    getline(basic_istream<char>&, string&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0
+  extern template class basic_string<wchar_t>;
+# elif ! _GLIBCXX_USE_CXX11_ABI
+  extern template basic_string<wchar_t>::size_type
+    basic_string<wchar_t>::_Rep::_S_empty_rep_storage[];
+# endif
+
+  extern template
+    basic_istream<wchar_t>&
+    operator>>(basic_istream<wchar_t>&, wstring&);
+  extern template
+    basic_ostream<wchar_t>&
+    operator<<(basic_ostream<wchar_t>&, const wstring&);
+  extern template
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+  extern template
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>&, wstring&);
+#endif // _GLIBCXX_USE_WCHAR_T
+#endif // _GLIBCXX_EXTERN_TEMPLATE
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 790 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/boost_concept_check.h

@@ -0,0 +1,790 @@
+// -*- C++ -*-
+
+// Copyright (C) 2004-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+
+/** @file bits/boost_concept_check.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iterator}
+ */
+
+// GCC Note:  based on version 1.12.0 of the Boost library.
+
+#ifndef _BOOST_CONCEPT_CHECK_H
+#define _BOOST_CONCEPT_CHECK_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_iterator_base_types.h>    // for traits and tags
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#define _IsUnused __attribute__ ((__unused__))
+
+// When the C-C code is in use, we would like this function to do as little
+// as possible at runtime, use as few resources as possible, and hopefully
+// be elided out of existence... hmmm.
+template <class _Concept>
+inline void __function_requires()
+{
+  void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
+}
+
+// No definition: if this is referenced, there's a problem with
+// the instantiating type not being one of the required integer types.
+// Unfortunately, this results in a link-time error, not a compile-time error.
+void __error_type_must_be_an_integer_type();
+void __error_type_must_be_an_unsigned_integer_type();
+void __error_type_must_be_a_signed_integer_type();
+
+// ??? Should the "concept_checking*" structs begin with more than _ ?
+#define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
+  typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
+  template <_func##_type_var##_concept _Tp1> \
+  struct _concept_checking##_type_var##_concept { }; \
+  typedef _concept_checking##_type_var##_concept< \
+    &_ns::_concept <_type_var>::__constraints> \
+    _concept_checking_typedef##_type_var##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
+  typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
+  template <_func##_type_var1##_type_var2##_concept _Tp1> \
+  struct _concept_checking##_type_var1##_type_var2##_concept { }; \
+  typedef _concept_checking##_type_var1##_type_var2##_concept< \
+    &_ns::_concept <_type_var1,_type_var2>::__constraints> \
+    _concept_checking_typedef##_type_var1##_type_var2##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
+  typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
+  template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
+  struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
+  typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
+    &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints>  \
+  _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
+  typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
+  template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
+  struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
+  typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
+  &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
+    _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
+
+
+template <class _Tp1, class _Tp2>
+struct _Aux_require_same { };
+
+template <class _Tp>
+struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
+
+  template <class _Tp1, class _Tp2>
+  struct _SameTypeConcept
+  {
+    void __constraints() {
+      typedef typename _Aux_require_same<_Tp1, _Tp2>::_Type _Required;
+    }
+  };
+
+  template <class _Tp>
+  struct _IntegerConcept {
+    void __constraints() {
+      __error_type_must_be_an_integer_type();
+    }
+  };
+  template <> struct _IntegerConcept<short> { void __constraints() {} };
+  template <> struct _IntegerConcept<unsigned short> { void __constraints(){} };
+  template <> struct _IntegerConcept<int> { void __constraints() {} };
+  template <> struct _IntegerConcept<unsigned int> { void __constraints() {} };
+  template <> struct _IntegerConcept<long> { void __constraints() {} };
+  template <> struct _IntegerConcept<unsigned long> { void __constraints() {} };
+  template <> struct _IntegerConcept<long long> { void __constraints() {} };
+  template <> struct _IntegerConcept<unsigned long long>
+                                                { void __constraints() {} };
+
+  template <class _Tp>
+  struct _SignedIntegerConcept {
+    void __constraints() {
+      __error_type_must_be_a_signed_integer_type();
+    }
+  };
+  template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
+  template <> struct _SignedIntegerConcept<int> { void __constraints() {} };
+  template <> struct _SignedIntegerConcept<long> { void __constraints() {} };
+  template <> struct _SignedIntegerConcept<long long> { void __constraints(){}};
+
+  template <class _Tp>
+  struct _UnsignedIntegerConcept {
+    void __constraints() {
+      __error_type_must_be_an_unsigned_integer_type();
+    }
+  };
+  template <> struct _UnsignedIntegerConcept<unsigned short>
+    { void __constraints() {} };
+  template <> struct _UnsignedIntegerConcept<unsigned int>
+    { void __constraints() {} };
+  template <> struct _UnsignedIntegerConcept<unsigned long>
+    { void __constraints() {} };
+  template <> struct _UnsignedIntegerConcept<unsigned long long>
+    { void __constraints() {} };
+
+  //===========================================================================
+  // Basic Concepts
+
+  template <class _Tp>
+  struct _DefaultConstructibleConcept
+  {
+    void __constraints() {
+      _Tp __a _IsUnused;                // require default constructor
+    }
+  };
+
+  template <class _Tp>
+  struct _AssignableConcept
+  {
+    void __constraints() {
+      __a = __a;                        // require assignment operator
+      __const_constraints(__a);
+    }
+    void __const_constraints(const _Tp& __b) {
+      __a = __b;                   // const required for argument to assignment
+    }
+    _Tp __a;
+    // possibly should be "Tp* a;" and then dereference "a" in constraint
+    // functions?  present way would require a default ctor, i think...
+  };
+
+  template <class _Tp>
+  struct _CopyConstructibleConcept
+  {
+    void __constraints() {
+      _Tp __a(__b);                     // require copy constructor
+      _Tp* __ptr _IsUnused = &__a;      // require address of operator
+      __const_constraints(__a);
+    }
+    void __const_constraints(const _Tp& __a) {
+      _Tp __c _IsUnused(__a);           // require const copy constructor
+      const _Tp* __ptr _IsUnused = &__a; // require const address of operator
+    }
+    _Tp __b;
+  };
+
+  // The SGI STL version of Assignable requires copy constructor and operator=
+  template <class _Tp>
+  struct _SGIAssignableConcept
+  {
+    void __constraints() {
+      _Tp __b _IsUnused(__a);
+      __a = __a;                        // require assignment operator
+      __const_constraints(__a);
+    }
+    void __const_constraints(const _Tp& __b) {
+      _Tp __c _IsUnused(__b);
+      __a = __b;              // const required for argument to assignment
+    }
+    _Tp __a;
+  };
+
+  template <class _From, class _To>
+  struct _ConvertibleConcept
+  {
+    void __constraints() {
+      _To __y _IsUnused = __x;
+    }
+    _From __x;
+  };
+
+  // The C++ standard requirements for many concepts talk about return
+  // types that must be "convertible to bool".  The problem with this
+  // requirement is that it leaves the door open for evil proxies that
+  // define things like operator|| with strange return types.  Two
+  // possible solutions are:
+  // 1) require the return type to be exactly bool
+  // 2) stay with convertible to bool, and also
+  //    specify stuff about all the logical operators.
+  // For now we just test for convertible to bool.
+  template <class _Tp>
+  void __aux_require_boolean_expr(const _Tp& __t) {
+    bool __x _IsUnused = __t;
+  }
+
+// FIXME
+  template <class _Tp>
+  struct _EqualityComparableConcept
+  {
+    void __constraints() {
+      __aux_require_boolean_expr(__a == __b);
+    }
+    _Tp __a, __b;
+  };
+
+  template <class _Tp>
+  struct _LessThanComparableConcept
+  {
+    void __constraints() {
+      __aux_require_boolean_expr(__a < __b);
+    }
+    _Tp __a, __b;
+  };
+
+  // This is equivalent to SGI STL's LessThanComparable.
+  template <class _Tp>
+  struct _ComparableConcept
+  {
+    void __constraints() {
+      __aux_require_boolean_expr(__a < __b);
+      __aux_require_boolean_expr(__a > __b);
+      __aux_require_boolean_expr(__a <= __b);
+      __aux_require_boolean_expr(__a >= __b);
+    }
+    _Tp __a, __b;
+  };
+
+#define _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
+  template <class _First, class _Second> \
+  struct _NAME { \
+    void __constraints() { (void)__constraints_(); } \
+    bool __constraints_() {  \
+      return  __a _OP __b; \
+    } \
+    _First __a; \
+    _Second __b; \
+  }
+
+#define _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
+  template <class _Ret, class _First, class _Second> \
+  struct _NAME { \
+    void __constraints() { (void)__constraints_(); } \
+    _Ret __constraints_() {  \
+      return __a _OP __b; \
+    } \
+    _First __a; \
+    _Second __b; \
+  }
+
+  _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept);
+  _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept);
+  _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept);
+  _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept);
+  _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept);
+  _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept);
+
+  _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept);
+  _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept);
+  _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept);
+  _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept);
+  _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept);
+
+#undef _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
+#undef _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT
+
+  //===========================================================================
+  // Function Object Concepts
+
+  template <class _Func, class _Return>
+  struct _GeneratorConcept
+  {
+    void __constraints() {
+      const _Return& __r _IsUnused = __f();// require operator() member function
+    }
+    _Func __f;
+  };
+
+
+  template <class _Func>
+  struct _GeneratorConcept<_Func,void>
+  {
+    void __constraints() {
+      __f();                            // require operator() member function
+    }
+    _Func __f;
+  };
+
+  template <class _Func, class _Return, class _Arg>
+  struct _UnaryFunctionConcept
+  {
+    void __constraints() {
+      __r = __f(__arg);                  // require operator()
+    }
+    _Func __f;
+    _Arg __arg;
+    _Return __r;
+  };
+
+  template <class _Func, class _Arg>
+  struct _UnaryFunctionConcept<_Func, void, _Arg> {
+    void __constraints() {
+      __f(__arg);                       // require operator()
+    }
+    _Func __f;
+    _Arg __arg;
+  };
+
+  template <class _Func, class _Return, class _First, class _Second>
+  struct _BinaryFunctionConcept
+  {
+    void __constraints() {
+      __r = __f(__first, __second);     // require operator()
+    }
+    _Func __f;
+    _First __first;
+    _Second __second;
+    _Return __r;
+  };
+
+  template <class _Func, class _First, class _Second>
+  struct _BinaryFunctionConcept<_Func, void, _First, _Second>
+  {
+    void __constraints() {
+      __f(__first, __second);           // require operator()
+    }
+    _Func __f;
+    _First __first;
+    _Second __second;
+  };
+
+  template <class _Func, class _Arg>
+  struct _UnaryPredicateConcept
+  {
+    void __constraints() {
+      __aux_require_boolean_expr(__f(__arg)); // require op() returning bool
+    }
+    _Func __f;
+    _Arg __arg;
+  };
+
+  template <class _Func, class _First, class _Second>
+  struct _BinaryPredicateConcept
+  {
+    void __constraints() {
+      __aux_require_boolean_expr(__f(__a, __b)); // require op() returning bool
+    }
+    _Func __f;
+    _First __a;
+    _Second __b;
+  };
+
+  // use this when functor is used inside a container class like std::set
+  template <class _Func, class _First, class _Second>
+  struct _Const_BinaryPredicateConcept {
+    void __constraints() {
+      __const_constraints(__f);
+    }
+    void __const_constraints(const _Func& __fun) {
+      __function_requires<_BinaryPredicateConcept<_Func, _First, _Second> >();
+      // operator() must be a const member function
+      __aux_require_boolean_expr(__fun(__a, __b));
+    }
+    _Func __f;
+    _First __a;
+    _Second __b;
+  };
+
+  //===========================================================================
+  // Iterator Concepts
+
+  template <class _Tp>
+  struct _TrivialIteratorConcept
+  {
+    void __constraints() {
+//    __function_requires< _DefaultConstructibleConcept<_Tp> >();
+      __function_requires< _AssignableConcept<_Tp> >();
+      __function_requires< _EqualityComparableConcept<_Tp> >();
+//      typedef typename std::iterator_traits<_Tp>::value_type _V;
+      (void)*__i;                       // require dereference operator
+    }
+    _Tp __i;
+  };
+
+  template <class _Tp>
+  struct _Mutable_TrivialIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _TrivialIteratorConcept<_Tp> >();
+      *__i = *__j;                      // require dereference and assignment
+    }
+    _Tp __i, __j;
+  };
+
+  template <class _Tp>
+  struct _InputIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _TrivialIteratorConcept<_Tp> >();
+      // require iterator_traits typedef's
+      typedef typename std::iterator_traits<_Tp>::difference_type _Diff;
+//      __function_requires< _SignedIntegerConcept<_Diff> >();
+      typedef typename std::iterator_traits<_Tp>::reference _Ref;
+      typedef typename std::iterator_traits<_Tp>::pointer _Pt;
+      typedef typename std::iterator_traits<_Tp>::iterator_category _Cat;
+      __function_requires< _ConvertibleConcept<
+        typename std::iterator_traits<_Tp>::iterator_category,
+        std::input_iterator_tag> >();
+      ++__i;                            // require preincrement operator
+      __i++;                            // require postincrement operator
+    }
+    _Tp __i;
+  };
+
+  template <class _Tp, class _ValueT>
+  struct _OutputIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _AssignableConcept<_Tp> >();
+      ++__i;                            // require preincrement operator
+      __i++;                            // require postincrement operator
+      *__i++ = __t;                     // require postincrement and assignment
+    }
+    _Tp __i;
+    _ValueT __t;
+  };
+
+  template <class _Tp>
+  struct _ForwardIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _InputIteratorConcept<_Tp> >();
+      __function_requires< _DefaultConstructibleConcept<_Tp> >();
+      __function_requires< _ConvertibleConcept<
+        typename std::iterator_traits<_Tp>::iterator_category,
+        std::forward_iterator_tag> >();
+      typedef typename std::iterator_traits<_Tp>::reference _Ref;
+      _Ref __r _IsUnused = *__i;
+    }
+    _Tp __i;
+  };
+
+  template <class _Tp>
+  struct _Mutable_ForwardIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _ForwardIteratorConcept<_Tp> >();
+      *__i++ = *__i;                    // require postincrement and assignment
+    }
+    _Tp __i;
+  };
+
+  template <class _Tp>
+  struct _BidirectionalIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _ForwardIteratorConcept<_Tp> >();
+      __function_requires< _ConvertibleConcept<
+        typename std::iterator_traits<_Tp>::iterator_category,
+        std::bidirectional_iterator_tag> >();
+      --__i;                            // require predecrement operator
+      __i--;                            // require postdecrement operator
+    }
+    _Tp __i;
+  };
+
+  template <class _Tp>
+  struct _Mutable_BidirectionalIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+      __function_requires< _Mutable_ForwardIteratorConcept<_Tp> >();
+      *__i-- = *__i;                    // require postdecrement and assignment
+    }
+    _Tp __i;
+  };
+
+
+  template <class _Tp>
+  struct _RandomAccessIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+      __function_requires< _ComparableConcept<_Tp> >();
+      __function_requires< _ConvertibleConcept<
+        typename std::iterator_traits<_Tp>::iterator_category,
+        std::random_access_iterator_tag> >();
+      // ??? We don't use _Ref, are we just checking for "referenceability"?
+      typedef typename std::iterator_traits<_Tp>::reference _Ref;
+
+      __i += __n;                       // require assignment addition operator
+      __i = __i + __n; __i = __n + __i; // require addition with difference type
+      __i -= __n;                       // require assignment subtraction op
+      __i = __i - __n;                  // require subtraction with
+                                        //            difference type
+      __n = __i - __j;                  // require difference operator
+      (void)__i[__n];                   // require element access operator
+    }
+    _Tp __a, __b;
+    _Tp __i, __j;
+    typename std::iterator_traits<_Tp>::difference_type __n;
+  };
+
+  template <class _Tp>
+  struct _Mutable_RandomAccessIteratorConcept
+  {
+    void __constraints() {
+      __function_requires< _RandomAccessIteratorConcept<_Tp> >();
+      __function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >();
+      __i[__n] = *__i;                  // require element access and assignment
+    }
+    _Tp __i;
+    typename std::iterator_traits<_Tp>::difference_type __n;
+  };
+
+  //===========================================================================
+  // Container Concepts
+
+  template <class _Container>
+  struct _ContainerConcept
+  {
+    typedef typename _Container::value_type _Value_type;
+    typedef typename _Container::difference_type _Difference_type;
+    typedef typename _Container::size_type _Size_type;
+    typedef typename _Container::const_reference _Const_reference;
+    typedef typename _Container::const_pointer _Const_pointer;
+    typedef typename _Container::const_iterator _Const_iterator;
+
+    void __constraints() {
+      __function_requires< _InputIteratorConcept<_Const_iterator> >();
+      __function_requires< _AssignableConcept<_Container> >();
+      const _Container __c;
+      __i = __c.begin();
+      __i = __c.end();
+      __n = __c.size();
+      __n = __c.max_size();
+      __b = __c.empty();
+    }
+    bool __b;
+    _Const_iterator __i;
+    _Size_type __n;
+  };
+
+  template <class _Container>
+  struct _Mutable_ContainerConcept
+  {
+    typedef typename _Container::value_type _Value_type;
+    typedef typename _Container::reference _Reference;
+    typedef typename _Container::iterator _Iterator;
+    typedef typename _Container::pointer _Pointer;
+
+    void __constraints() {
+      __function_requires< _ContainerConcept<_Container> >();
+      __function_requires< _AssignableConcept<_Value_type> >();
+      __function_requires< _InputIteratorConcept<_Iterator> >();
+
+      __i = __c.begin();
+      __i = __c.end();
+      __c.swap(__c2);
+    }
+    _Iterator __i;
+    _Container __c, __c2;
+  };
+
+  template <class _ForwardContainer>
+  struct _ForwardContainerConcept
+  {
+    void __constraints() {
+      __function_requires< _ContainerConcept<_ForwardContainer> >();
+      typedef typename _ForwardContainer::const_iterator _Const_iterator;
+      __function_requires< _ForwardIteratorConcept<_Const_iterator> >();
+    }
+  };
+
+  template <class _ForwardContainer>
+  struct _Mutable_ForwardContainerConcept
+  {
+    void __constraints() {
+      __function_requires< _ForwardContainerConcept<_ForwardContainer> >();
+      __function_requires< _Mutable_ContainerConcept<_ForwardContainer> >();
+      typedef typename _ForwardContainer::iterator _Iterator;
+      __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
+    }
+  };
+
+  template <class _ReversibleContainer>
+  struct _ReversibleContainerConcept
+  {
+    typedef typename _ReversibleContainer::const_iterator _Const_iterator;
+    typedef typename _ReversibleContainer::const_reverse_iterator
+      _Const_reverse_iterator;
+
+    void __constraints() {
+      __function_requires< _ForwardContainerConcept<_ReversibleContainer> >();
+      __function_requires< _BidirectionalIteratorConcept<_Const_iterator> >();
+      __function_requires<
+        _BidirectionalIteratorConcept<_Const_reverse_iterator> >();
+
+      const _ReversibleContainer __c;
+      _Const_reverse_iterator __i = __c.rbegin();
+      __i = __c.rend();
+    }
+  };
+
+  template <class _ReversibleContainer>
+  struct _Mutable_ReversibleContainerConcept
+  {
+    typedef typename _ReversibleContainer::iterator _Iterator;
+    typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator;
+
+    void __constraints() {
+      __function_requires<_ReversibleContainerConcept<_ReversibleContainer> >();
+      __function_requires<
+        _Mutable_ForwardContainerConcept<_ReversibleContainer> >();
+      __function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >();
+      __function_requires<
+        _Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >();
+
+      _Reverse_iterator __i = __c.rbegin();
+      __i = __c.rend();
+    }
+    _ReversibleContainer __c;
+  };
+
+  template <class _RandomAccessContainer>
+  struct _RandomAccessContainerConcept
+  {
+    typedef typename _RandomAccessContainer::size_type _Size_type;
+    typedef typename _RandomAccessContainer::const_reference _Const_reference;
+    typedef typename _RandomAccessContainer::const_iterator _Const_iterator;
+    typedef typename _RandomAccessContainer::const_reverse_iterator
+      _Const_reverse_iterator;
+
+    void __constraints() {
+      __function_requires<
+        _ReversibleContainerConcept<_RandomAccessContainer> >();
+      __function_requires< _RandomAccessIteratorConcept<_Const_iterator> >();
+      __function_requires<
+        _RandomAccessIteratorConcept<_Const_reverse_iterator> >();
+
+      const _RandomAccessContainer __c;
+      _Const_reference __r _IsUnused = __c[__n];
+    }
+    _Size_type __n;
+  };
+
+  template <class _RandomAccessContainer>
+  struct _Mutable_RandomAccessContainerConcept
+  {
+    typedef typename _RandomAccessContainer::size_type _Size_type;
+    typedef typename _RandomAccessContainer::reference _Reference;
+    typedef typename _RandomAccessContainer::iterator _Iterator;
+    typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator;
+
+    void __constraints() {
+      __function_requires<
+        _RandomAccessContainerConcept<_RandomAccessContainer> >();
+      __function_requires<
+        _Mutable_ReversibleContainerConcept<_RandomAccessContainer> >();
+      __function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >();
+      __function_requires<
+        _Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >();
+
+      _Reference __r _IsUnused = __c[__i];
+    }
+    _Size_type __i;
+    _RandomAccessContainer __c;
+  };
+
+  // A Sequence is inherently mutable
+  template <class _Sequence>
+  struct _SequenceConcept
+  {
+    typedef typename _Sequence::reference _Reference;
+    typedef typename _Sequence::const_reference _Const_reference;
+
+    void __constraints() {
+      // Matt Austern's book puts DefaultConstructible here, the C++
+      // standard places it in Container
+      //    function_requires< DefaultConstructible<Sequence> >();
+      __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
+      __function_requires< _DefaultConstructibleConcept<_Sequence> >();
+
+      _Sequence
+	__c _IsUnused(__n, __t),
+        __c2 _IsUnused(__first, __last);
+
+      __c.insert(__p, __t);
+      __c.insert(__p, __n, __t);
+      __c.insert(__p, __first, __last);
+
+      __c.erase(__p);
+      __c.erase(__p, __q);
+
+      _Reference __r _IsUnused = __c.front();
+
+      __const_constraints(__c);
+    }
+    void __const_constraints(const _Sequence& __c) {
+      _Const_reference __r _IsUnused = __c.front();
+    }
+    typename _Sequence::value_type __t;
+    typename _Sequence::size_type __n;
+    typename _Sequence::value_type *__first, *__last;
+    typename _Sequence::iterator __p, __q;
+  };
+
+  template <class _FrontInsertionSequence>
+  struct _FrontInsertionSequenceConcept
+  {
+    void __constraints() {
+      __function_requires< _SequenceConcept<_FrontInsertionSequence> >();
+
+      __c.push_front(__t);
+      __c.pop_front();
+    }
+    _FrontInsertionSequence __c;
+    typename _FrontInsertionSequence::value_type __t;
+  };
+
+  template <class _BackInsertionSequence>
+  struct _BackInsertionSequenceConcept
+  {
+    typedef typename _BackInsertionSequence::reference _Reference;
+    typedef typename _BackInsertionSequence::const_reference _Const_reference;
+
+    void __constraints() {
+      __function_requires< _SequenceConcept<_BackInsertionSequence> >();
+
+      __c.push_back(__t);
+      __c.pop_back();
+      _Reference __r _IsUnused = __c.back();
+    }
+    void __const_constraints(const _BackInsertionSequence& __c) {
+      _Const_reference __r _IsUnused = __c.back();
+    };
+    _BackInsertionSequence __c;
+    typename _BackInsertionSequence::value_type __t;
+  };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#undef _IsUnused
+
+#endif // _GLIBCXX_BOOST_CONCEPT_CHECK
+
+

+ 37 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/c++0x_warning.h

@@ -0,0 +1,37 @@
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/c++0x_warning.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _CXX0X_WARNING_H
+#define _CXX0X_WARNING_H 1
+
+#if __cplusplus < 201103L
+#error This file requires compiler and library support \
+for the ISO C++ 2011 standard. This support must be enabled \
+with the -std=c++11 or -std=gnu++11 compiler options.
+#endif
+
+#endif

+ 706 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/char_traits.h

@@ -0,0 +1,706 @@
+// Character Traits for use by standard string and iostream -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/char_traits.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{string}
+ */
+
+//
+// ISO C++ 14882: 21  Strings library
+//
+
+#ifndef _CHAR_TRAITS_H
+#define _CHAR_TRAITS_H 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>  // std::copy, std::fill_n
+#include <bits/postypes.h>      // For streampos
+#include <cwchar>               // For WEOF, wmemmove, wmemset, etc.
+
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @brief  Mapping from character type to associated types.
+   *
+   *  @note This is an implementation class for the generic version
+   *  of char_traits.  It defines int_type, off_type, pos_type, and
+   *  state_type.  By default these are unsigned long, streamoff,
+   *  streampos, and mbstate_t.  Users who need a different set of
+   *  types, but who don't need to change the definitions of any function
+   *  defined in char_traits, can specialize __gnu_cxx::_Char_types
+   *  while leaving __gnu_cxx::char_traits alone. */
+  template<typename _CharT>
+    struct _Char_types
+    {
+      typedef unsigned long   int_type;
+      typedef std::streampos  pos_type;
+      typedef std::streamoff  off_type;
+      typedef std::mbstate_t  state_type;
+    };
+
+
+  /**
+   *  @brief  Base class used to implement std::char_traits.
+   *
+   *  @note For any given actual character type, this definition is
+   *  probably wrong.  (Most of the member functions are likely to be
+   *  right, but the int_type and state_type typedefs, and the eof()
+   *  member function, are likely to be wrong.)  The reason this class
+   *  exists is so users can specialize it.  Classes in namespace std
+   *  may not be specialized for fundamental types, but classes in
+   *  namespace __gnu_cxx may be.
+   *
+   *  See https://gcc.gnu.org/onlinedocs/libstdc++/manual/strings.html#strings.string.character_types
+   *  for advice on how to make use of this class for @a unusual character
+   *  types. Also, check out include/ext/pod_char_traits.h.  
+   */
+  template<typename _CharT>
+    struct char_traits
+    {
+      typedef _CharT                                    char_type;
+      typedef typename _Char_types<_CharT>::int_type    int_type;
+      typedef typename _Char_types<_CharT>::pos_type    pos_type;
+      typedef typename _Char_types<_CharT>::off_type    off_type;
+      typedef typename _Char_types<_CharT>::state_type  state_type;
+
+      static _GLIBCXX14_CONSTEXPR void
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static _GLIBCXX_CONSTEXPR bool
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static _GLIBCXX_CONSTEXPR bool
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static _GLIBCXX14_CONSTEXPR int
+      compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static _GLIBCXX14_CONSTEXPR std::size_t
+      length(const char_type* __s);
+
+      static _GLIBCXX14_CONSTEXPR const char_type*
+      find(const char_type* __s, std::size_t __n, const char_type& __a);
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static char_type*
+      assign(char_type* __s, std::size_t __n, char_type __a);
+
+      static _GLIBCXX_CONSTEXPR char_type
+      to_char_type(const int_type& __c)
+      { return static_cast<char_type>(__c); }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      to_int_type(const char_type& __c)
+      { return static_cast<int_type>(__c); }
+
+      static _GLIBCXX_CONSTEXPR bool
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      eof()
+      { return static_cast<int_type>(_GLIBCXX_STDIO_EOF); }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      not_eof(const int_type& __c)
+      { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+    };
+
+  template<typename _CharT>
+    _GLIBCXX14_CONSTEXPR int
+    char_traits<_CharT>::
+    compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      for (std::size_t __i = 0; __i < __n; ++__i)
+	if (lt(__s1[__i], __s2[__i]))
+	  return -1;
+	else if (lt(__s2[__i], __s1[__i]))
+	  return 1;
+      return 0;
+    }
+
+  template<typename _CharT>
+    _GLIBCXX14_CONSTEXPR std::size_t
+    char_traits<_CharT>::
+    length(const char_type* __p)
+    {
+      std::size_t __i = 0;
+      while (!eq(__p[__i], char_type()))
+        ++__i;
+      return __i;
+    }
+
+  template<typename _CharT>
+    _GLIBCXX14_CONSTEXPR const typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    find(const char_type* __s, std::size_t __n, const char_type& __a)
+    {
+      for (std::size_t __i = 0; __i < __n; ++__i)
+        if (eq(__s[__i], __a))
+          return __s + __i;
+      return 0;
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    move(char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+						    __n * sizeof(char_type)));
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      // NB: Inline std::copy so no recursive dependencies.
+      std::copy(__s2, __s2 + __n, __s1);
+      return __s1;
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    assign(char_type* __s, std::size_t __n, char_type __a)
+    {
+      // NB: Inline std::fill_n so no recursive dependencies.
+      std::fill_n(__s, __n, __a);
+      return __s;
+    }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#if __cplusplus > 201402
+#define __cpp_lib_constexpr_char_traits 201611
+
+  /**
+   *  @brief Determine whether the characters of a NULL-terminated
+   *  string are known at compile time.
+   *  @param  __s  The string.
+   *
+   *  Assumes that _CharT is a built-in character type.
+   */
+  template<typename _CharT>
+    static _GLIBCXX_ALWAYS_INLINE constexpr bool
+    __constant_string_p(const _CharT* __s)
+    {
+      while (__builtin_constant_p(*__s) && *__s)
+	__s++;
+      return __builtin_constant_p(*__s);
+    }
+
+  /**
+   *  @brief Determine whether the characters of a character array are
+   *  known at compile time.
+   *  @param  __a  The character array.
+   *  @param  __n  Number of characters.
+   *
+   *  Assumes that _CharT is a built-in character type.
+   */
+  template<typename _CharT>
+    static _GLIBCXX_ALWAYS_INLINE constexpr bool
+    __constant_char_array_p(const _CharT* __a, size_t __n)
+    {
+      size_t __i = 0;
+      while (__i < __n && __builtin_constant_p(__a[__i]))
+	__i++;
+      return __i == __n;
+    }
+#endif
+
+  // 21.1
+  /**
+   *  @brief  Basis for explicit traits specializations.
+   *
+   *  @note  For any given actual character type, this definition is
+   *  probably wrong.  Since this is just a thin wrapper around
+   *  __gnu_cxx::char_traits, it is possible to achieve a more
+   *  appropriate definition by specializing __gnu_cxx::char_traits.
+   *
+   *  See https://gcc.gnu.org/onlinedocs/libstdc++/manual/strings.html#strings.string.character_types
+   *  for advice on how to make use of this class for @a unusual character
+   *  types. Also, check out include/ext/pod_char_traits.h.
+  */
+  template<class _CharT>
+    struct char_traits : public __gnu_cxx::char_traits<_CharT>
+    { };
+
+
+  /// 21.1.3.1  char_traits specializations
+  template<>
+    struct char_traits<char>
+    {
+      typedef char              char_type;
+      typedef int               int_type;
+      typedef streampos         pos_type;
+      typedef streamoff         off_type;
+      typedef mbstate_t         state_type;
+
+      static _GLIBCXX17_CONSTEXPR void
+      assign(char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+      { __c1 = __c2; }
+
+      static _GLIBCXX_CONSTEXPR bool
+      eq(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+      { return __c1 == __c2; }
+
+      static _GLIBCXX_CONSTEXPR bool
+      lt(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+      {
+	// LWG 467.
+	return (static_cast<unsigned char>(__c1)
+		< static_cast<unsigned char>(__c2));
+      }
+
+      static _GLIBCXX17_CONSTEXPR int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+#if __cplusplus > 201402
+	if (__builtin_constant_p(__n)
+	    && __constant_char_array_p(__s1, __n)
+	    && __constant_char_array_p(__s2, __n))
+	  return __gnu_cxx::char_traits<char_type>::compare(__s1, __s2, __n);
+#endif
+	if (__n == 0)
+	  return 0;
+	return __builtin_memcmp(__s1, __s2, __n);
+      }
+
+      static _GLIBCXX17_CONSTEXPR size_t
+      length(const char_type* __s)
+      {
+#if __cplusplus > 201402
+	if (__constant_string_p(__s))
+	  return __gnu_cxx::char_traits<char_type>::length(__s);
+#endif
+	return __builtin_strlen(__s);
+      }
+
+      static _GLIBCXX17_CONSTEXPR const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+#if __cplusplus > 201402
+	if (__builtin_constant_p(__n)
+	    && __builtin_constant_p(__a)
+	    && __constant_char_array_p(__s, __n))
+	  return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a);
+#endif
+	if (__n == 0)
+	  return 0;
+	return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n));
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+	if (__n == 0)
+	  return __s;
+	return static_cast<char_type*>(__builtin_memset(__s, __a, __n));
+      }
+
+      static _GLIBCXX_CONSTEXPR char_type
+      to_char_type(const int_type& __c) _GLIBCXX_NOEXCEPT
+      { return static_cast<char_type>(__c); }
+
+      // To keep both the byte 0xff and the eof symbol 0xffffffff
+      // from ending up as 0xffffffff.
+      static _GLIBCXX_CONSTEXPR int_type
+      to_int_type(const char_type& __c) _GLIBCXX_NOEXCEPT
+      { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+
+      static _GLIBCXX_CONSTEXPR bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) _GLIBCXX_NOEXCEPT
+      { return __c1 == __c2; }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      eof() _GLIBCXX_NOEXCEPT
+      { return static_cast<int_type>(_GLIBCXX_STDIO_EOF); }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      not_eof(const int_type& __c) _GLIBCXX_NOEXCEPT
+      { return (__c == eof()) ? 0 : __c; }
+  };
+
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  /// 21.1.3.2  char_traits specializations
+  template<>
+    struct char_traits<wchar_t>
+    {
+      typedef wchar_t           char_type;
+      typedef wint_t            int_type;
+      typedef streamoff         off_type;
+      typedef wstreampos        pos_type;
+      typedef mbstate_t         state_type;
+
+      static _GLIBCXX17_CONSTEXPR void
+      assign(char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+      { __c1 = __c2; }
+
+      static _GLIBCXX_CONSTEXPR bool
+      eq(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+      { return __c1 == __c2; }
+
+      static _GLIBCXX_CONSTEXPR bool
+      lt(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+      { return __c1 < __c2; }
+
+      static _GLIBCXX17_CONSTEXPR int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+#if __cplusplus > 201402
+	if (__builtin_constant_p(__n)
+	    && __constant_char_array_p(__s1, __n)
+	    && __constant_char_array_p(__s2, __n))
+	  return __gnu_cxx::char_traits<char_type>::compare(__s1, __s2, __n);
+#endif
+	if (__n == 0)
+	  return 0;
+	else
+	  return wmemcmp(__s1, __s2, __n);
+      }
+
+      static _GLIBCXX17_CONSTEXPR size_t
+      length(const char_type* __s)
+      {
+#if __cplusplus > 201402
+	if (__constant_string_p(__s))
+	  return __gnu_cxx::char_traits<char_type>::length(__s);
+	else
+#endif
+	  return wcslen(__s);
+      }
+
+      static _GLIBCXX17_CONSTEXPR const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+#if __cplusplus > 201402
+	if (__builtin_constant_p(__n)
+	    && __builtin_constant_p(__a)
+	    && __constant_char_array_p(__s, __n))
+	  return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a);
+#endif
+	if (__n == 0)
+	  return 0;
+	else
+	  return wmemchr(__s, __a, __n);
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return wmemmove(__s1, __s2, __n);
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return wmemcpy(__s1, __s2, __n);
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+	if (__n == 0)
+	  return __s;
+	return wmemset(__s, __a, __n);
+      }
+
+      static _GLIBCXX_CONSTEXPR char_type
+      to_char_type(const int_type& __c) _GLIBCXX_NOEXCEPT
+      { return char_type(__c); }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      to_int_type(const char_type& __c) _GLIBCXX_NOEXCEPT
+      { return int_type(__c); }
+
+      static _GLIBCXX_CONSTEXPR bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) _GLIBCXX_NOEXCEPT
+      { return __c1 == __c2; }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      eof() _GLIBCXX_NOEXCEPT
+      { return static_cast<int_type>(WEOF); }
+
+      static _GLIBCXX_CONSTEXPR int_type
+      not_eof(const int_type& __c) _GLIBCXX_NOEXCEPT
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+  };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#if ((__cplusplus >= 201103L) \
+     && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+#include <cstdint>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<>
+    struct char_traits<char16_t>
+    {
+      typedef char16_t          char_type;
+      typedef uint_least16_t    int_type;
+      typedef streamoff         off_type;
+      typedef u16streampos      pos_type;
+      typedef mbstate_t         state_type;
+
+      static _GLIBCXX17_CONSTEXPR void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static _GLIBCXX17_CONSTEXPR int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	for (size_t __i = 0; __i < __n; ++__i)
+	  if (lt(__s1[__i], __s2[__i]))
+	    return -1;
+	  else if (lt(__s2[__i], __s1[__i]))
+	    return 1;
+	return 0;
+      }
+
+      static _GLIBCXX17_CONSTEXPR size_t
+      length(const char_type* __s)
+      {
+	size_t __i = 0;
+	while (!eq(__s[__i], char_type()))
+	  ++__i;
+	return __i;
+      }
+
+      static _GLIBCXX17_CONSTEXPR const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+	for (size_t __i = 0; __i < __n; ++__i)
+	  if (eq(__s[__i], __a))
+	    return __s + __i;
+	return 0;
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return (static_cast<char_type*>
+		(__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return (static_cast<char_type*>
+		(__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+	for (size_t __i = 0; __i < __n; ++__i)
+	  assign(__s[__i], __a);
+	return __s;
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+    };
+
+  template<>
+    struct char_traits<char32_t>
+    {
+      typedef char32_t          char_type;
+      typedef uint_least32_t    int_type;
+      typedef streamoff         off_type;
+      typedef u32streampos      pos_type;
+      typedef mbstate_t         state_type;
+
+      static _GLIBCXX17_CONSTEXPR void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static _GLIBCXX17_CONSTEXPR int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	for (size_t __i = 0; __i < __n; ++__i)
+	  if (lt(__s1[__i], __s2[__i]))
+	    return -1;
+	  else if (lt(__s2[__i], __s1[__i]))
+	    return 1;
+	return 0;
+      }
+
+      static _GLIBCXX17_CONSTEXPR size_t
+      length(const char_type* __s)
+      {
+	size_t __i = 0;
+	while (!eq(__s[__i], char_type()))
+	  ++__i;
+	return __i;
+      }
+
+      static _GLIBCXX17_CONSTEXPR const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+	for (size_t __i = 0; __i < __n; ++__i)
+	  if (eq(__s[__i], __a))
+	    return __s + __i;
+	return 0;
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+	if (__n == 0)
+	  return __s1;
+	return (static_cast<char_type*>
+		(__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      { 
+	if (__n == 0)
+	  return __s1;
+	return (static_cast<char_type*>
+		(__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+	for (size_t __i = 0; __i < __n; ++__i)
+	  assign(__s[__i], __a);
+	return __s;
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif 
+
+#endif // _CHAR_TRAITS_H

+ 681 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/codecvt.h

@@ -0,0 +1,681 @@
+// Locale support (codecvt) -*- C++ -*-
+
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/codecvt.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.2.1.5 Template class codecvt
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _CODECVT_H
+#define _CODECVT_H 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /// Empty base class for codecvt facet [22.2.1.5].
+  class codecvt_base
+  {
+  public:
+    enum result
+    {
+      ok,
+      partial,
+      error,
+      noconv
+    };
+  };
+
+  /**
+   *  @brief  Common base for codecvt functions.
+   *
+   *  This template class provides implementations of the public functions
+   *  that forward to the protected virtual functions.
+   *
+   *  This template also provides abstract stubs for the protected virtual
+   *  functions.
+  */
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class __codecvt_abstract_base
+    : public locale::facet, public codecvt_base
+    {
+    public:
+      // Types:
+      typedef codecvt_base::result	result;
+      typedef _InternT			intern_type;
+      typedef _ExternT			extern_type;
+      typedef _StateT			state_type;
+
+      // 22.2.1.5.1 codecvt members
+      /**
+       *  @brief  Convert from internal to external character set.
+       *
+       *  Converts input string of intern_type to output string of
+       *  extern_type.  This is analogous to wcsrtombs.  It does this by
+       *  calling codecvt::do_out.
+       *
+       *  The source and destination character sets are determined by the
+       *  facet's locale, internal and external types.
+       *
+       *  The characters in [from,from_end) are converted and written to
+       *  [to,to_end).  from_next and to_next are set to point to the
+       *  character following the last successfully converted character,
+       *  respectively.  If the result needed no conversion, from_next and
+       *  to_next are not affected.
+       *
+       *  The @a state argument should be initialized if the input is at the
+       *  beginning and carried from a previous call if continuing
+       *  conversion.  There are no guarantees about how @a state is used.
+       *
+       *  The result returned is a member of codecvt_base::result.  If
+       *  all the input is converted, returns codecvt_base::ok.  If no
+       *  conversion is necessary, returns codecvt_base::noconv.  If
+       *  the input ends early or there is insufficient space in the
+       *  output, returns codecvt_base::partial.  Otherwise the
+       *  conversion failed and codecvt_base::error is returned.
+       *
+       *  @param  __state  Persistent conversion state data.
+       *  @param  __from  Start of input.
+       *  @param  __from_end  End of input.
+       *  @param  __from_next  Returns start of unconverted data.
+       *  @param  __to  Start of output buffer.
+       *  @param  __to_end  End of output buffer.
+       *  @param  __to_next  Returns start of unused output area.
+       *  @return  codecvt_base::result.
+      */
+      result
+      out(state_type& __state, const intern_type* __from,
+	  const intern_type* __from_end, const intern_type*& __from_next,
+	  extern_type* __to, extern_type* __to_end,
+	  extern_type*& __to_next) const
+      {
+	return this->do_out(__state, __from, __from_end, __from_next,
+			    __to, __to_end, __to_next);
+      }
+
+      /**
+       *  @brief  Reset conversion state.
+       *
+       *  Writes characters to output that would restore @a state to initial
+       *  conditions.  The idea is that if a partial conversion occurs, then
+       *  the converting the characters written by this function would leave
+       *  the state in initial conditions, rather than partial conversion
+       *  state.  It does this by calling codecvt::do_unshift().
+       *
+       *  For example, if 4 external characters always converted to 1 internal
+       *  character, and input to in() had 6 external characters with state
+       *  saved, this function would write two characters to the output and
+       *  set the state to initialized conditions.
+       *
+       *  The source and destination character sets are determined by the
+       *  facet's locale, internal and external types.
+       *
+       *  The result returned is a member of codecvt_base::result.  If the
+       *  state could be reset and data written, returns codecvt_base::ok.  If
+       *  no conversion is necessary, returns codecvt_base::noconv.  If the
+       *  output has insufficient space, returns codecvt_base::partial.
+       *  Otherwise the reset failed and codecvt_base::error is returned.
+       *
+       *  @param  __state  Persistent conversion state data.
+       *  @param  __to  Start of output buffer.
+       *  @param  __to_end  End of output buffer.
+       *  @param  __to_next  Returns start of unused output area.
+       *  @return  codecvt_base::result.
+      */
+      result
+      unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
+	      extern_type*& __to_next) const
+      { return this->do_unshift(__state, __to,__to_end,__to_next); }
+
+      /**
+       *  @brief  Convert from external to internal character set.
+       *
+       *  Converts input string of extern_type to output string of
+       *  intern_type.  This is analogous to mbsrtowcs.  It does this by
+       *  calling codecvt::do_in.
+       *
+       *  The source and destination character sets are determined by the
+       *  facet's locale, internal and external types.
+       *
+       *  The characters in [from,from_end) are converted and written to
+       *  [to,to_end).  from_next and to_next are set to point to the
+       *  character following the last successfully converted character,
+       *  respectively.  If the result needed no conversion, from_next and
+       *  to_next are not affected.
+       *
+       *  The @a state argument should be initialized if the input is at the
+       *  beginning and carried from a previous call if continuing
+       *  conversion.  There are no guarantees about how @a state is used.
+       *
+       *  The result returned is a member of codecvt_base::result.  If
+       *  all the input is converted, returns codecvt_base::ok.  If no
+       *  conversion is necessary, returns codecvt_base::noconv.  If
+       *  the input ends early or there is insufficient space in the
+       *  output, returns codecvt_base::partial.  Otherwise the
+       *  conversion failed and codecvt_base::error is returned.
+       *
+       *  @param  __state  Persistent conversion state data.
+       *  @param  __from  Start of input.
+       *  @param  __from_end  End of input.
+       *  @param  __from_next  Returns start of unconverted data.
+       *  @param  __to  Start of output buffer.
+       *  @param  __to_end  End of output buffer.
+       *  @param  __to_next  Returns start of unused output area.
+       *  @return  codecvt_base::result.
+      */
+      result
+      in(state_type& __state, const extern_type* __from,
+	 const extern_type* __from_end, const extern_type*& __from_next,
+	 intern_type* __to, intern_type* __to_end,
+	 intern_type*& __to_next) const
+      {
+	return this->do_in(__state, __from, __from_end, __from_next,
+			   __to, __to_end, __to_next);
+      }
+
+      int
+      encoding() const throw()
+      { return this->do_encoding(); }
+
+      bool
+      always_noconv() const throw()
+      { return this->do_always_noconv(); }
+
+      int
+      length(state_type& __state, const extern_type* __from,
+	     const extern_type* __end, size_t __max) const
+      { return this->do_length(__state, __from, __end, __max); }
+
+      int
+      max_length() const throw()
+      { return this->do_max_length(); }
+
+    protected:
+      explicit
+      __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }
+
+      virtual
+      ~__codecvt_abstract_base() { }
+
+      /**
+       *  @brief  Convert from internal to external character set.
+       *
+       *  Converts input string of intern_type to output string of
+       *  extern_type.  This function is a hook for derived classes to change
+       *  the value returned.  @see out for more information.
+      */
+      virtual result
+      do_out(state_type& __state, const intern_type* __from,
+	     const intern_type* __from_end, const intern_type*& __from_next,
+	     extern_type* __to, extern_type* __to_end,
+	     extern_type*& __to_next) const = 0;
+
+      virtual result
+      do_unshift(state_type& __state, extern_type* __to,
+		 extern_type* __to_end, extern_type*& __to_next) const = 0;
+
+      virtual result
+      do_in(state_type& __state, const extern_type* __from,
+	    const extern_type* __from_end, const extern_type*& __from_next,
+	    intern_type* __to, intern_type* __to_end,
+	    intern_type*& __to_next) const = 0;
+
+      virtual int
+      do_encoding() const throw() = 0;
+
+      virtual bool
+      do_always_noconv() const throw() = 0;
+
+      virtual int
+      do_length(state_type&, const extern_type* __from,
+		const extern_type* __end, size_t __max) const = 0;
+
+      virtual int
+      do_max_length() const throw() = 0;
+    };
+
+  /**
+   *  @brief  Primary class template codecvt.
+   *  @ingroup locales
+   *
+   *  NB: Generic, mostly useless implementation.
+   *
+  */
+   template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt
+    : public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
+    {
+    public:
+      // Types:
+      typedef codecvt_base::result	result;
+      typedef _InternT			intern_type;
+      typedef _ExternT			extern_type;
+      typedef _StateT			state_type;
+
+    protected:
+      __c_locale			_M_c_locale_codecvt;
+
+    public:
+      static locale::id			id;
+
+      explicit
+      codecvt(size_t __refs = 0)
+      : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs),
+	_M_c_locale_codecvt(0)
+      { }
+
+      explicit
+      codecvt(__c_locale __cloc, size_t __refs = 0);
+
+    protected:
+      virtual
+      ~codecvt() { }
+
+      virtual result
+      do_out(state_type& __state, const intern_type* __from,
+	     const intern_type* __from_end, const intern_type*& __from_next,
+	     extern_type* __to, extern_type* __to_end,
+	     extern_type*& __to_next) const;
+
+      virtual result
+      do_unshift(state_type& __state, extern_type* __to,
+		 extern_type* __to_end, extern_type*& __to_next) const;
+
+      virtual result
+      do_in(state_type& __state, const extern_type* __from,
+	    const extern_type* __from_end, const extern_type*& __from_next,
+	    intern_type* __to, intern_type* __to_end,
+	    intern_type*& __to_next) const;
+
+      virtual int
+      do_encoding() const throw();
+
+      virtual bool
+      do_always_noconv() const throw();
+
+      virtual int
+      do_length(state_type&, const extern_type* __from,
+		const extern_type* __end, size_t __max) const;
+
+      virtual int
+      do_max_length() const throw();
+    };
+
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    locale::id codecvt<_InternT, _ExternT, _StateT>::id;
+
+  /// class codecvt<char, char, mbstate_t> specialization.
+  template<>
+    class codecvt<char, char, mbstate_t>
+    : public __codecvt_abstract_base<char, char, mbstate_t>
+    {
+      friend class messages<char>;
+
+    public:
+      // Types:
+      typedef char			intern_type;
+      typedef char			extern_type;
+      typedef mbstate_t			state_type;
+
+    protected:
+      __c_locale			_M_c_locale_codecvt;
+
+    public:
+      static locale::id id;
+
+      explicit
+      codecvt(size_t __refs = 0);
+
+      explicit
+      codecvt(__c_locale __cloc, size_t __refs = 0);
+
+    protected:
+      virtual
+      ~codecvt();
+
+      virtual result
+      do_out(state_type& __state, const intern_type* __from,
+	     const intern_type* __from_end, const intern_type*& __from_next,
+	     extern_type* __to, extern_type* __to_end,
+	     extern_type*& __to_next) const;
+
+      virtual result
+      do_unshift(state_type& __state, extern_type* __to,
+		 extern_type* __to_end, extern_type*& __to_next) const;
+
+      virtual result
+      do_in(state_type& __state, const extern_type* __from,
+	    const extern_type* __from_end, const extern_type*& __from_next,
+	    intern_type* __to, intern_type* __to_end,
+	    intern_type*& __to_next) const;
+
+      virtual int
+      do_encoding() const throw();
+
+      virtual bool
+      do_always_noconv() const throw();
+
+      virtual int
+      do_length(state_type&, const extern_type* __from,
+		const extern_type* __end, size_t __max) const;
+
+      virtual int
+      do_max_length() const throw();
+  };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  /** @brief  Class codecvt<wchar_t, char, mbstate_t> specialization.
+   *
+   *  Converts between narrow and wide characters in the native character set
+   */
+  template<>
+    class codecvt<wchar_t, char, mbstate_t>
+    : public __codecvt_abstract_base<wchar_t, char, mbstate_t>
+    {
+      friend class messages<wchar_t>;
+
+    public:
+      // Types:
+      typedef wchar_t			intern_type;
+      typedef char			extern_type;
+      typedef mbstate_t			state_type;
+
+    protected:
+      __c_locale			_M_c_locale_codecvt;
+
+    public:
+      static locale::id			id;
+
+      explicit
+      codecvt(size_t __refs = 0);
+
+      explicit
+      codecvt(__c_locale __cloc, size_t __refs = 0);
+
+    protected:
+      virtual
+      ~codecvt();
+
+      virtual result
+      do_out(state_type& __state, const intern_type* __from,
+	     const intern_type* __from_end, const intern_type*& __from_next,
+	     extern_type* __to, extern_type* __to_end,
+	     extern_type*& __to_next) const;
+
+      virtual result
+      do_unshift(state_type& __state,
+		 extern_type* __to, extern_type* __to_end,
+		 extern_type*& __to_next) const;
+
+      virtual result
+      do_in(state_type& __state,
+	     const extern_type* __from, const extern_type* __from_end,
+	     const extern_type*& __from_next,
+	     intern_type* __to, intern_type* __to_end,
+	     intern_type*& __to_next) const;
+
+      virtual
+      int do_encoding() const throw();
+
+      virtual
+      bool do_always_noconv() const throw();
+
+      virtual
+      int do_length(state_type&, const extern_type* __from,
+		    const extern_type* __end, size_t __max) const;
+
+      virtual int
+      do_max_length() const throw();
+    };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+#if __cplusplus >= 201103L
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+  /** @brief  Class codecvt<char16_t, char, mbstate_t> specialization.
+   *
+   *  Converts between UTF-16 and UTF-8.
+   */
+  template<>
+    class codecvt<char16_t, char, mbstate_t>
+    : public __codecvt_abstract_base<char16_t, char, mbstate_t>
+    {
+    public:
+      // Types:
+      typedef char16_t			intern_type;
+      typedef char			extern_type;
+      typedef mbstate_t			state_type;
+
+    public:
+      static locale::id			id;
+
+      explicit
+      codecvt(size_t __refs = 0)
+      : __codecvt_abstract_base<char16_t, char, mbstate_t>(__refs) { }
+
+    protected:
+      virtual
+      ~codecvt();
+
+      virtual result
+      do_out(state_type& __state, const intern_type* __from,
+	     const intern_type* __from_end, const intern_type*& __from_next,
+	     extern_type* __to, extern_type* __to_end,
+	     extern_type*& __to_next) const;
+
+      virtual result
+      do_unshift(state_type& __state,
+		 extern_type* __to, extern_type* __to_end,
+		 extern_type*& __to_next) const;
+
+      virtual result
+      do_in(state_type& __state,
+	     const extern_type* __from, const extern_type* __from_end,
+	     const extern_type*& __from_next,
+	     intern_type* __to, intern_type* __to_end,
+	     intern_type*& __to_next) const;
+
+      virtual
+      int do_encoding() const throw();
+
+      virtual
+      bool do_always_noconv() const throw();
+
+      virtual
+      int do_length(state_type&, const extern_type* __from,
+		    const extern_type* __end, size_t __max) const;
+
+      virtual int
+      do_max_length() const throw();
+    };
+
+  /** @brief  Class codecvt<char32_t, char, mbstate_t> specialization.
+   *
+   *  Converts between UTF-32 and UTF-8.
+   */
+  template<>
+    class codecvt<char32_t, char, mbstate_t>
+    : public __codecvt_abstract_base<char32_t, char, mbstate_t>
+    {
+    public:
+      // Types:
+      typedef char32_t			intern_type;
+      typedef char			extern_type;
+      typedef mbstate_t			state_type;
+
+    public:
+      static locale::id			id;
+
+      explicit
+      codecvt(size_t __refs = 0)
+      : __codecvt_abstract_base<char32_t, char, mbstate_t>(__refs) { }
+
+    protected:
+      virtual
+      ~codecvt();
+
+      virtual result
+      do_out(state_type& __state, const intern_type* __from,
+	     const intern_type* __from_end, const intern_type*& __from_next,
+	     extern_type* __to, extern_type* __to_end,
+	     extern_type*& __to_next) const;
+
+      virtual result
+      do_unshift(state_type& __state,
+		 extern_type* __to, extern_type* __to_end,
+		 extern_type*& __to_next) const;
+
+      virtual result
+      do_in(state_type& __state,
+	     const extern_type* __from, const extern_type* __from_end,
+	     const extern_type*& __from_next,
+	     intern_type* __to, intern_type* __to_end,
+	     intern_type*& __to_next) const;
+
+      virtual
+      int do_encoding() const throw();
+
+      virtual
+      bool do_always_noconv() const throw();
+
+      virtual
+      int do_length(state_type&, const extern_type* __from,
+		    const extern_type* __end, size_t __max) const;
+
+      virtual int
+      do_max_length() const throw();
+    };
+
+#endif // _GLIBCXX_USE_C99_STDINT_TR1
+#endif // C++11
+
+  /// class codecvt_byname [22.2.1.6].
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
+    {
+    public:
+      explicit
+      codecvt_byname(const char* __s, size_t __refs = 0)
+      : codecvt<_InternT, _ExternT, _StateT>(__refs)
+      {
+	if (__builtin_strcmp(__s, "C") != 0
+	    && __builtin_strcmp(__s, "POSIX") != 0)
+	  {
+	    this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
+	    this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
+	  }
+      }
+
+#if __cplusplus >= 201103L
+      explicit
+      codecvt_byname(const string& __s, size_t __refs = 0)
+      : codecvt_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~codecvt_byname() { }
+    };
+
+#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+  template<>
+    class codecvt_byname<char16_t, char, mbstate_t>
+    : public codecvt<char16_t, char, mbstate_t>
+    {
+    public:
+      explicit
+      codecvt_byname(const char* __s, size_t __refs = 0)
+      : codecvt<char16_t, char, mbstate_t>(__refs) { }
+
+      explicit
+      codecvt_byname(const string& __s, size_t __refs = 0)
+      : codecvt_byname(__s.c_str(), __refs) { }
+
+    protected:
+      virtual
+      ~codecvt_byname() { }
+    };
+
+  template<>
+    class codecvt_byname<char32_t, char, mbstate_t>
+    : public codecvt<char32_t, char, mbstate_t>
+    {
+    public:
+      explicit
+      codecvt_byname(const char* __s, size_t __refs = 0)
+      : codecvt<char32_t, char, mbstate_t>(__refs) { }
+
+      explicit
+      codecvt_byname(const string& __s, size_t __refs = 0)
+      : codecvt_byname(__s.c_str(), __refs) { }
+
+    protected:
+      virtual
+      ~codecvt_byname() { }
+    };
+#endif
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class codecvt_byname<char, char, mbstate_t>;
+
+  extern template
+    const codecvt<char, char, mbstate_t>&
+    use_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+
+  extern template
+    const codecvt<wchar_t, char, mbstate_t>&
+    use_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+#endif
+
+#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+  extern template class codecvt_byname<char16_t, char, mbstate_t>;
+  extern template class codecvt_byname<char32_t, char, mbstate_t>;
+#endif
+
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif // _CODECVT_H

+ 81 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/concept_check.h

@@ -0,0 +1,81 @@
+// Concept-checking control -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/concept_check.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{iterator}
+ */
+
+#ifndef _CONCEPT_CHECK_H
+#define _CONCEPT_CHECK_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+// All places in libstdc++-v3 where these are used, or /might/ be used, or
+// don't need to be used, or perhaps /should/ be used, are commented with
+// "concept requirements" (and maybe some more text).  So grep like crazy
+// if you're looking for additional places to use these.
+
+// Concept-checking code is off by default unless users turn it on via
+// configure options or editing c++config.h.
+// It is not supported for freestanding implementations.
+
+#if !defined(_GLIBCXX_CONCEPT_CHECKS) || !_GLIBCXX_HOSTED
+
+#define __glibcxx_function_requires(...)
+#define __glibcxx_class_requires(_a,_b)
+#define __glibcxx_class_requires2(_a,_b,_c)
+#define __glibcxx_class_requires3(_a,_b,_c,_d)
+#define __glibcxx_class_requires4(_a,_b,_c,_d,_e)
+
+#else // the checks are on
+
+#include <bits/boost_concept_check.h>
+
+// Note that the obvious and elegant approach of
+//
+//#define glibcxx_function_requires(C) debug::function_requires< debug::C >()
+//
+// won't work due to concept templates with more than one parameter, e.g.,
+// BinaryPredicateConcept.  The preprocessor tries to split things up on
+// the commas in the template argument list.  We can't use an inner pair of
+// parenthesis to hide the commas, because "debug::(Temp<Foo,Bar>)" isn't
+// a valid instantiation pattern.  Thus, we steal a feature from C99.
+
+#define __glibcxx_function_requires(...)                                 \
+            __gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >();
+#define __glibcxx_class_requires(_a,_C)                                  \
+            _GLIBCXX_CLASS_REQUIRES(_a, __gnu_cxx, _C);
+#define __glibcxx_class_requires2(_a,_b,_C)                              \
+            _GLIBCXX_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C);
+#define __glibcxx_class_requires3(_a,_b,_c,_C)                           \
+            _GLIBCXX_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C);
+#define __glibcxx_class_requires4(_a,_b,_c,_d,_C)                        \
+            _GLIBCXX_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C);
+
+#endif // enable/disable
+
+#endif // _GLIBCXX_CONCEPT_CHECK

+ 415 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/cpp_type_traits.h

@@ -0,0 +1,415 @@
+// The  -*- C++ -*- type traits classes for internal use in libstdc++
+
+// Copyright (C) 2000-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cpp_type_traits.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ext/type_traits}
+ */
+
+// Written by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+
+#ifndef _CPP_TYPE_TRAITS_H
+#define _CPP_TYPE_TRAITS_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+//
+// This file provides some compile-time information about various types.
+// These representations were designed, on purpose, to be constant-expressions
+// and not types as found in <bits/type_traits.h>.  In particular, they
+// can be used in control structures and the optimizer hopefully will do
+// the obvious thing.
+//
+// Why integral expressions, and not functions nor types?
+// Firstly, these compile-time entities are used as template-arguments
+// so function return values won't work:  We need compile-time entities.
+// We're left with types and constant  integral expressions.
+// Secondly, from the point of view of ease of use, type-based compile-time
+// information is -not- *that* convenient.  On has to write lots of
+// overloaded functions and to hope that the compiler will select the right
+// one. As a net effect, the overall structure isn't very clear at first
+// glance.
+// Thirdly, partial ordering and overload resolution (of function templates)
+// is highly costly in terms of compiler-resource.  It is a Good Thing to
+// keep these resource consumption as least as possible.
+//
+// See valarray_array.h for a case use.
+//
+// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
+//
+// Update 2005: types are also provided and <bits/type_traits.h> has been
+// removed.
+//
+
+extern "C++" {
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  struct __true_type { };
+  struct __false_type { };
+
+  template<bool>
+    struct __truth_type
+    { typedef __false_type __type; };
+
+  template<>
+    struct __truth_type<true>
+    { typedef __true_type __type; };
+
+  // N.B. The conversions to bool are needed due to the issue
+  // explained in c++/19404.
+  template<class _Sp, class _Tp>
+    struct __traitor
+    {
+      enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+      typedef typename __truth_type<__value>::__type __type;
+    };
+
+  // Compare for equality of types.
+  template<typename, typename>
+    struct __are_same
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __are_same<_Tp, _Tp>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  // Holds if the template-argument is a void type.
+  template<typename _Tp>
+    struct __is_void
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_void<void>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  //
+  // Integer types
+  //
+  template<typename _Tp>
+    struct __is_integer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  // Thirteen specializations (yes there are eleven standard integer
+  // types; <em>long long</em> and <em>unsigned long long</em> are
+  // supported as extensions).  Up to four target-specific __int<N>
+  // types are supported as well.
+  template<>
+    struct __is_integer<bool>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+# ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    struct __is_integer<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+# endif
+
+#if __cplusplus >= 201103L
+  template<>
+    struct __is_integer<char16_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char32_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+#endif
+
+  template<>
+    struct __is_integer<short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+#define __INT_N(TYPE) 			\
+  template<>				\
+    struct __is_integer<TYPE>		\
+    {					\
+      enum { __value = 1 };		\
+      typedef __true_type __type;	\
+    };					\
+  template<>				\
+    struct __is_integer<unsigned TYPE>	\
+    {					\
+      enum { __value = 1 };		\
+      typedef __true_type __type;	\
+    };
+
+#ifdef __GLIBCXX_TYPE_INT_N_0
+__INT_N(__GLIBCXX_TYPE_INT_N_0)
+#endif
+#ifdef __GLIBCXX_TYPE_INT_N_1
+__INT_N(__GLIBCXX_TYPE_INT_N_1)
+#endif
+#ifdef __GLIBCXX_TYPE_INT_N_2
+__INT_N(__GLIBCXX_TYPE_INT_N_2)
+#endif
+#ifdef __GLIBCXX_TYPE_INT_N_3
+__INT_N(__GLIBCXX_TYPE_INT_N_3)
+#endif
+
+#undef __INT_N
+
+  //
+  // Floating point types
+  //
+  template<typename _Tp>
+    struct __is_floating
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  // three specializations (float, double and 'long double')
+  template<>
+    struct __is_floating<float>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<long double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  //
+  // Pointer types
+  //
+  template<typename _Tp>
+    struct __is_pointer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __is_pointer<_Tp*>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  //
+  // An arithmetic type is an integer type or a floating point type
+  //
+  template<typename _Tp>
+    struct __is_arithmetic
+    : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+    { };
+
+  //
+  // A scalar type is an arithmetic type or a pointer type
+  // 
+  template<typename _Tp>
+    struct __is_scalar
+    : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+    { };
+
+  //
+  // For use in std::copy and std::find overloads for streambuf iterators.
+  //
+  template<typename _Tp>
+    struct __is_char
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_char<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    struct __is_char<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+#endif
+
+  template<typename _Tp>
+    struct __is_byte
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_byte<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  //
+  // Move iterator type
+  //
+  template<typename _Tp>
+    struct __is_move_iterator
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  // Fallback implementation of the function in bits/stl_iterator.h used to
+  // remove the move_iterator wrapper.
+  template<typename _Iterator>
+    inline _Iterator
+    __miter_base(_Iterator __it)
+    { return __it; }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+} // extern "C++"
+
+#endif //_CPP_TYPE_TRAITS_H

+ 60 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/cxxabi_forced.h

@@ -0,0 +1,60 @@
+// cxxabi.h subset for cancellation -*- C++ -*-
+  
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+// 
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cxxabi_forced.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{cxxabi.h}
+ */
+
+#ifndef _CXXABI_FORCED_H
+#define _CXXABI_FORCED_H 1
+
+#pragma GCC system_header
+
+#pragma GCC visibility push(default)
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{  
+  /** 
+   *  @brief Thrown as part of forced unwinding.
+   *  @ingroup exceptions
+   *
+   *  A magic placeholder class that can be caught by reference to
+   *  recognize forced unwinding.
+   */
+  class __forced_unwind
+  {
+    virtual ~__forced_unwind() throw();
+
+    // Prevent catch by value.
+    virtual void __pure_dummy() = 0; 
+  };
+}
+#endif // __cplusplus
+
+#pragma GCC visibility pop
+
+#endif // __CXXABI_FORCED_H 

+ 80 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/cxxabi_init_exception.h

@@ -0,0 +1,80 @@
+// ABI Support -*- C++ -*-
+
+// Copyright (C) 2016-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cxxabi_init_exception.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly.
+ */
+
+#ifndef _CXXABI_INIT_EXCEPTION_H
+#define _CXXABI_INIT_EXCEPTION_H 1
+
+#pragma GCC system_header
+
+#pragma GCC visibility push(default)
+
+#include <stddef.h>
+#include <bits/c++config.h>
+
+#ifndef _GLIBCXX_CDTOR_CALLABI
+#define _GLIBCXX_CDTOR_CALLABI
+#define _GLIBCXX_HAVE_CDTOR_CALLABI 0
+#else
+#define _GLIBCXX_HAVE_CDTOR_CALLABI 1
+#endif
+
+#ifdef __cplusplus
+
+namespace std
+{
+  class type_info;
+}
+
+namespace __cxxabiv1
+{
+  struct __cxa_refcounted_exception;
+
+  extern "C"
+    {
+      // Allocate memory for the primary exception plus the thrown object.
+      void*
+      __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
+
+      void
+      __cxa_free_exception(void*) _GLIBCXX_NOTHROW;
+
+      // Initialize exception (this is a GNU extension)
+      __cxa_refcounted_exception*
+      __cxa_init_primary_exception(void *object, std::type_info *tinfo,
+                void (_GLIBCXX_CDTOR_CALLABI *dest) (void *)) _GLIBCXX_NOTHROW;
+
+    }
+} // namespace __cxxabiv1
+
+#endif
+
+#pragma GCC visibility pop
+
+#endif // _CXXABI_INIT_EXCEPTION_H

+ 1112 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/deque.tcc

@@ -0,0 +1,1112 @@
+// Deque implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file bits/deque.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{deque}
+ */
+
+#ifndef _DEQUE_TCC
+#define _DEQUE_TCC 1
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+
+#if __cplusplus >= 201103L
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_default_initialize()
+    {
+      _Map_pointer __cur;
+      __try
+        {
+          for (__cur = this->_M_impl._M_start._M_node;
+	       __cur < this->_M_impl._M_finish._M_node;
+	       ++__cur)
+            std::__uninitialized_default_a(*__cur, *__cur + _S_buffer_size(),
+					   _M_get_Tp_allocator());
+          std::__uninitialized_default_a(this->_M_impl._M_finish._M_first,
+					 this->_M_impl._M_finish._M_cur,
+					 _M_get_Tp_allocator());
+        }
+      __catch(...)
+        {
+          std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
+			_M_get_Tp_allocator());
+          __throw_exception_again;
+        }
+    }
+#endif
+
+  template <typename _Tp, typename _Alloc>
+    deque<_Tp, _Alloc>&
+    deque<_Tp, _Alloc>::
+    operator=(const deque& __x)
+    {
+      if (&__x != this)
+	{
+#if __cplusplus >= 201103L
+	  if (_Alloc_traits::_S_propagate_on_copy_assign())
+	    {
+	      if (!_Alloc_traits::_S_always_equal()
+	          && _M_get_Tp_allocator() != __x._M_get_Tp_allocator())
+	        {
+		  // Replacement allocator cannot free existing storage,
+		  // so deallocate everything and take copy of __x's data.
+		  _M_replace_map(__x, __x.get_allocator());
+		  std::__alloc_on_copy(_M_get_Tp_allocator(),
+				       __x._M_get_Tp_allocator());
+		  return *this;
+		}
+	      std::__alloc_on_copy(_M_get_Tp_allocator(),
+				   __x._M_get_Tp_allocator());
+	    }
+#endif
+	  const size_type __len = size();
+	  if (__len >= __x.size())
+	    _M_erase_at_end(std::copy(__x.begin(), __x.end(),
+				      this->_M_impl._M_start));
+	  else
+	    {
+	      const_iterator __mid = __x.begin() + difference_type(__len);
+	      std::copy(__x.begin(), __mid, this->_M_impl._M_start);
+	      _M_range_insert_aux(this->_M_impl._M_finish, __mid, __x.end(),
+				  std::random_access_iterator_tag());
+	    }
+	}
+      return *this;
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+#if __cplusplus > 201402L
+      typename deque<_Tp, _Alloc>::reference
+#else
+      void
+#endif
+      deque<_Tp, _Alloc>::
+      emplace_front(_Args&&... __args)
+      {
+	if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
+	  {
+	    _Alloc_traits::construct(this->_M_impl,
+	                             this->_M_impl._M_start._M_cur - 1,
+			             std::forward<_Args>(__args)...);
+	    --this->_M_impl._M_start._M_cur;
+	  }
+	else
+	  _M_push_front_aux(std::forward<_Args>(__args)...);
+#if __cplusplus > 201402L
+	return front();
+#endif
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+#if __cplusplus > 201402L
+      typename deque<_Tp, _Alloc>::reference
+#else
+      void
+#endif
+      deque<_Tp, _Alloc>::
+      emplace_back(_Args&&... __args)
+      {
+	if (this->_M_impl._M_finish._M_cur
+	    != this->_M_impl._M_finish._M_last - 1)
+	  {
+	    _Alloc_traits::construct(this->_M_impl,
+	                             this->_M_impl._M_finish._M_cur,
+			             std::forward<_Args>(__args)...);
+	    ++this->_M_impl._M_finish._M_cur;
+	  }
+	else
+	  _M_push_back_aux(std::forward<_Args>(__args)...);
+#if __cplusplus > 201402L
+	return back();
+#endif
+      }
+#endif
+
+#if __cplusplus >= 201103L
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+      typename deque<_Tp, _Alloc>::iterator
+      deque<_Tp, _Alloc>::
+      emplace(const_iterator __position, _Args&&... __args)
+      {
+	if (__position._M_cur == this->_M_impl._M_start._M_cur)
+	  {
+	    emplace_front(std::forward<_Args>(__args)...);
+	    return this->_M_impl._M_start;
+	  }
+	else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+	  {
+	    emplace_back(std::forward<_Args>(__args)...);
+	    iterator __tmp = this->_M_impl._M_finish;
+	    --__tmp;
+	    return __tmp;
+	  }
+	else
+	  return _M_insert_aux(__position._M_const_cast(),
+			       std::forward<_Args>(__args)...);
+      }
+#endif
+
+  template <typename _Tp, typename _Alloc>
+    typename deque<_Tp, _Alloc>::iterator
+    deque<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    insert(const_iterator __position, const value_type& __x)
+#else
+    insert(iterator __position, const value_type& __x)
+#endif
+    {
+      if (__position._M_cur == this->_M_impl._M_start._M_cur)
+	{
+	  push_front(__x);
+	  return this->_M_impl._M_start;
+	}
+      else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+	{
+	  push_back(__x);
+	  iterator __tmp = this->_M_impl._M_finish;
+	  --__tmp;
+	  return __tmp;
+	}
+      else
+	return _M_insert_aux(__position._M_const_cast(), __x);
+   }
+
+  template <typename _Tp, typename _Alloc>
+    typename deque<_Tp, _Alloc>::iterator
+    deque<_Tp, _Alloc>::
+    _M_erase(iterator __position)
+    {
+      iterator __next = __position;
+      ++__next;
+      const difference_type __index = __position - begin();
+      if (static_cast<size_type>(__index) < (size() >> 1))
+	{
+	  if (__position != begin())
+	    _GLIBCXX_MOVE_BACKWARD3(begin(), __position, __next);
+	  pop_front();
+	}
+      else
+	{
+	  if (__next != end())
+	    _GLIBCXX_MOVE3(__next, end(), __position);
+	  pop_back();
+	}
+      return begin() + __index;
+    }
+
+  template <typename _Tp, typename _Alloc>
+    typename deque<_Tp, _Alloc>::iterator
+    deque<_Tp, _Alloc>::
+    _M_erase(iterator __first, iterator __last)
+    {
+      if (__first == __last)
+	return __first;
+      else if (__first == begin() && __last == end())
+	{
+	  clear();
+	  return end();
+	}
+      else
+	{
+	  const difference_type __n = __last - __first;
+	  const difference_type __elems_before = __first - begin();
+	  if (static_cast<size_type>(__elems_before) <= (size() - __n) / 2)
+	    {
+	      if (__first != begin())
+		_GLIBCXX_MOVE_BACKWARD3(begin(), __first, __last);
+	      _M_erase_at_begin(begin() + __n);
+	    }
+	  else
+	    {
+	      if (__last != end())
+		_GLIBCXX_MOVE3(__last, end(), __first);
+	      _M_erase_at_end(end() - __n);
+	    }
+	  return begin() + __elems_before;
+	}
+    }
+
+  template <typename _Tp, class _Alloc>
+    template <typename _InputIterator>
+      void
+      deque<_Tp, _Alloc>::
+      _M_assign_aux(_InputIterator __first, _InputIterator __last,
+		    std::input_iterator_tag)
+      {
+        iterator __cur = begin();
+        for (; __first != __last && __cur != end(); ++__cur, ++__first)
+          *__cur = *__first;
+        if (__first == __last)
+          _M_erase_at_end(__cur);
+        else
+          _M_range_insert_aux(end(), __first, __last,
+			      std::__iterator_category(__first));
+      }
+
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
+    {
+      if (__pos._M_cur == this->_M_impl._M_start._M_cur)
+	{
+	  iterator __new_start = _M_reserve_elements_at_front(__n);
+	  __try
+	    {
+	      std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start,
+					  __x, _M_get_Tp_allocator());
+	      this->_M_impl._M_start = __new_start;
+	    }
+	  __catch(...)
+	    {
+	      _M_destroy_nodes(__new_start._M_node,
+			       this->_M_impl._M_start._M_node);
+	      __throw_exception_again;
+	    }
+	}
+      else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
+	{
+	  iterator __new_finish = _M_reserve_elements_at_back(__n);
+	  __try
+	    {
+	      std::__uninitialized_fill_a(this->_M_impl._M_finish,
+					  __new_finish, __x,
+					  _M_get_Tp_allocator());
+	      this->_M_impl._M_finish = __new_finish;
+	    }
+	  __catch(...)
+	    {
+	      _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+			       __new_finish._M_node + 1);
+	      __throw_exception_again;
+	    }
+	}
+      else
+        _M_insert_aux(__pos, __n, __x);
+    }
+
+#if __cplusplus >= 201103L
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_default_append(size_type __n)
+    {
+      if (__n)
+	{
+	  iterator __new_finish = _M_reserve_elements_at_back(__n);
+	  __try
+	    {
+	      std::__uninitialized_default_a(this->_M_impl._M_finish,
+					     __new_finish,
+					     _M_get_Tp_allocator());
+	      this->_M_impl._M_finish = __new_finish;
+	    }
+	  __catch(...)
+	    {
+	      _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+			       __new_finish._M_node + 1);
+	      __throw_exception_again;
+	    }
+	}
+    }
+
+  template <typename _Tp, typename _Alloc>
+    bool
+    deque<_Tp, _Alloc>::
+    _M_shrink_to_fit()
+    {
+      const difference_type __front_capacity
+	= (this->_M_impl._M_start._M_cur - this->_M_impl._M_start._M_first);
+      if (__front_capacity == 0)
+	return false;
+
+      const difference_type __back_capacity
+	= (this->_M_impl._M_finish._M_last - this->_M_impl._M_finish._M_cur);
+      if (__front_capacity + __back_capacity < _S_buffer_size())
+	return false;
+
+      return std::__shrink_to_fit_aux<deque>::_S_do_it(*this);
+    }
+#endif
+
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_fill_initialize(const value_type& __value)
+    {
+      _Map_pointer __cur;
+      __try
+        {
+          for (__cur = this->_M_impl._M_start._M_node;
+	       __cur < this->_M_impl._M_finish._M_node;
+	       ++__cur)
+            std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
+					__value, _M_get_Tp_allocator());
+          std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first,
+				      this->_M_impl._M_finish._M_cur,
+				      __value, _M_get_Tp_allocator());
+        }
+      __catch(...)
+        {
+          std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
+			_M_get_Tp_allocator());
+          __throw_exception_again;
+        }
+    }
+
+  template <typename _Tp, typename _Alloc>
+    template <typename _InputIterator>
+      void
+      deque<_Tp, _Alloc>::
+      _M_range_initialize(_InputIterator __first, _InputIterator __last,
+                          std::input_iterator_tag)
+      {
+        this->_M_initialize_map(0);
+        __try
+          {
+            for (; __first != __last; ++__first)
+#if __cplusplus >= 201103L
+	      emplace_back(*__first);
+#else
+              push_back(*__first);
+#endif
+          }
+        __catch(...)
+          {
+            clear();
+            __throw_exception_again;
+          }
+      }
+
+  template <typename _Tp, typename _Alloc>
+    template <typename _ForwardIterator>
+      void
+      deque<_Tp, _Alloc>::
+      _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
+                          std::forward_iterator_tag)
+      {
+        const size_type __n = std::distance(__first, __last);
+        this->_M_initialize_map(__n);
+
+        _Map_pointer __cur_node;
+        __try
+          {
+            for (__cur_node = this->_M_impl._M_start._M_node;
+                 __cur_node < this->_M_impl._M_finish._M_node;
+                 ++__cur_node)
+	      {
+		_ForwardIterator __mid = __first;
+		std::advance(__mid, _S_buffer_size());
+		std::__uninitialized_copy_a(__first, __mid, *__cur_node,
+					    _M_get_Tp_allocator());
+		__first = __mid;
+	      }
+            std::__uninitialized_copy_a(__first, __last,
+					this->_M_impl._M_finish._M_first,
+					_M_get_Tp_allocator());
+          }
+        __catch(...)
+          {
+            std::_Destroy(this->_M_impl._M_start,
+			  iterator(*__cur_node, __cur_node),
+			  _M_get_Tp_allocator());
+            __throw_exception_again;
+          }
+      }
+
+  // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1.
+  template<typename _Tp, typename _Alloc>
+#if __cplusplus >= 201103L
+    template<typename... _Args>
+      void
+      deque<_Tp, _Alloc>::
+      _M_push_back_aux(_Args&&... __args)
+#else
+      void
+      deque<_Tp, _Alloc>::
+      _M_push_back_aux(const value_type& __t)
+#endif
+      {
+	_M_reserve_map_at_back();
+	*(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
+	__try
+	  {
+#if __cplusplus >= 201103L
+	    _Alloc_traits::construct(this->_M_impl,
+	                             this->_M_impl._M_finish._M_cur,
+			             std::forward<_Args>(__args)...);
+#else
+	    this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
+#endif
+	    this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
+						+ 1);
+	    this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
+	  }
+	__catch(...)
+	  {
+	    _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
+	    __throw_exception_again;
+	  }
+      }
+
+  // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first.
+  template<typename _Tp, typename _Alloc>
+#if __cplusplus >= 201103L
+    template<typename... _Args>
+      void
+      deque<_Tp, _Alloc>::
+      _M_push_front_aux(_Args&&... __args)
+#else
+      void
+      deque<_Tp, _Alloc>::
+      _M_push_front_aux(const value_type& __t)
+#endif
+      {
+	_M_reserve_map_at_front();
+	*(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
+	__try
+	  {
+	    this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
+					       - 1);
+	    this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
+#if __cplusplus >= 201103L
+	    _Alloc_traits::construct(this->_M_impl,
+	                             this->_M_impl._M_start._M_cur,
+			             std::forward<_Args>(__args)...);
+#else
+	    this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
+#endif
+	  }
+	__catch(...)
+	  {
+	    ++this->_M_impl._M_start;
+	    _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
+	    __throw_exception_again;
+	  }
+      }
+
+  // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first.
+  template <typename _Tp, typename _Alloc>
+    void deque<_Tp, _Alloc>::
+    _M_pop_back_aux()
+    {
+      _M_deallocate_node(this->_M_impl._M_finish._M_first);
+      this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
+      this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
+      _Alloc_traits::destroy(_M_get_Tp_allocator(),
+			     this->_M_impl._M_finish._M_cur);
+    }
+
+  // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1.
+  // Note that if the deque has at least one element (a precondition for this
+  // member function), and if
+  //   _M_impl._M_start._M_cur == _M_impl._M_start._M_last,
+  // then the deque must have at least two nodes.
+  template <typename _Tp, typename _Alloc>
+    void deque<_Tp, _Alloc>::
+    _M_pop_front_aux()
+    {
+      _Alloc_traits::destroy(_M_get_Tp_allocator(),
+			     this->_M_impl._M_start._M_cur);
+      _M_deallocate_node(this->_M_impl._M_start._M_first);
+      this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
+      this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
+    }
+
+  template <typename _Tp, typename _Alloc>
+    template <typename _InputIterator>
+      void
+      deque<_Tp, _Alloc>::
+      _M_range_insert_aux(iterator __pos,
+                          _InputIterator __first, _InputIterator __last,
+                          std::input_iterator_tag)
+      { std::copy(__first, __last, std::inserter(*this, __pos)); }
+
+  template <typename _Tp, typename _Alloc>
+    template <typename _ForwardIterator>
+      void
+      deque<_Tp, _Alloc>::
+      _M_range_insert_aux(iterator __pos,
+                          _ForwardIterator __first, _ForwardIterator __last,
+                          std::forward_iterator_tag)
+      {
+        const size_type __n = std::distance(__first, __last);
+        if (__pos._M_cur == this->_M_impl._M_start._M_cur)
+	  {
+	    iterator __new_start = _M_reserve_elements_at_front(__n);
+	    __try
+	      {
+		std::__uninitialized_copy_a(__first, __last, __new_start,
+					    _M_get_Tp_allocator());
+		this->_M_impl._M_start = __new_start;
+	      }
+	    __catch(...)
+	      {
+		_M_destroy_nodes(__new_start._M_node,
+				 this->_M_impl._M_start._M_node);
+		__throw_exception_again;
+	      }
+	  }
+        else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
+	  {
+	    iterator __new_finish = _M_reserve_elements_at_back(__n);
+	    __try
+	      {
+		std::__uninitialized_copy_a(__first, __last,
+					    this->_M_impl._M_finish,
+					    _M_get_Tp_allocator());
+		this->_M_impl._M_finish = __new_finish;
+	      }
+	    __catch(...)
+	      {
+		_M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+				 __new_finish._M_node + 1);
+		__throw_exception_again;
+	      }
+	  }
+        else
+          _M_insert_aux(__pos, __first, __last, __n);
+      }
+
+  template<typename _Tp, typename _Alloc>
+#if __cplusplus >= 201103L
+    template<typename... _Args>
+      typename deque<_Tp, _Alloc>::iterator
+      deque<_Tp, _Alloc>::
+      _M_insert_aux(iterator __pos, _Args&&... __args)
+      {
+	value_type __x_copy(std::forward<_Args>(__args)...); // XXX copy
+#else
+    typename deque<_Tp, _Alloc>::iterator
+      deque<_Tp, _Alloc>::
+      _M_insert_aux(iterator __pos, const value_type& __x)
+      {
+	value_type __x_copy = __x; // XXX copy
+#endif
+	difference_type __index = __pos - this->_M_impl._M_start;
+	if (static_cast<size_type>(__index) < size() / 2)
+	  {
+	    push_front(_GLIBCXX_MOVE(front()));
+	    iterator __front1 = this->_M_impl._M_start;
+	    ++__front1;
+	    iterator __front2 = __front1;
+	    ++__front2;
+	    __pos = this->_M_impl._M_start + __index;
+	    iterator __pos1 = __pos;
+	    ++__pos1;
+	    _GLIBCXX_MOVE3(__front2, __pos1, __front1);
+	  }
+	else
+	  {
+	    push_back(_GLIBCXX_MOVE(back()));
+	    iterator __back1 = this->_M_impl._M_finish;
+	    --__back1;
+	    iterator __back2 = __back1;
+	    --__back2;
+	    __pos = this->_M_impl._M_start + __index;
+	    _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
+	  }
+	*__pos = _GLIBCXX_MOVE(__x_copy);
+	return __pos;
+      }
+
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_insert_aux(iterator __pos, size_type __n, const value_type& __x)
+    {
+      const difference_type __elems_before = __pos - this->_M_impl._M_start;
+      const size_type __length = this->size();
+      value_type __x_copy = __x;
+      if (__elems_before < difference_type(__length / 2))
+	{
+	  iterator __new_start = _M_reserve_elements_at_front(__n);
+	  iterator __old_start = this->_M_impl._M_start;
+	  __pos = this->_M_impl._M_start + __elems_before;
+	  __try
+	    {
+	      if (__elems_before >= difference_type(__n))
+		{
+		  iterator __start_n = (this->_M_impl._M_start
+					+ difference_type(__n));
+		  std::__uninitialized_move_a(this->_M_impl._M_start,
+					      __start_n, __new_start,
+					      _M_get_Tp_allocator());
+		  this->_M_impl._M_start = __new_start;
+		  _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
+		  std::fill(__pos - difference_type(__n), __pos, __x_copy);
+		}
+	      else
+		{
+		  std::__uninitialized_move_fill(this->_M_impl._M_start,
+						 __pos, __new_start,
+						 this->_M_impl._M_start,
+						 __x_copy,
+						 _M_get_Tp_allocator());
+		  this->_M_impl._M_start = __new_start;
+		  std::fill(__old_start, __pos, __x_copy);
+		}
+	    }
+	  __catch(...)
+	    {
+	      _M_destroy_nodes(__new_start._M_node,
+			       this->_M_impl._M_start._M_node);
+	      __throw_exception_again;
+	    }
+	}
+      else
+	{
+	  iterator __new_finish = _M_reserve_elements_at_back(__n);
+	  iterator __old_finish = this->_M_impl._M_finish;
+	  const difference_type __elems_after =
+	    difference_type(__length) - __elems_before;
+	  __pos = this->_M_impl._M_finish - __elems_after;
+	  __try
+	    {
+	      if (__elems_after > difference_type(__n))
+		{
+		  iterator __finish_n = (this->_M_impl._M_finish
+					 - difference_type(__n));
+		  std::__uninitialized_move_a(__finish_n,
+					      this->_M_impl._M_finish,
+					      this->_M_impl._M_finish,
+					      _M_get_Tp_allocator());
+		  this->_M_impl._M_finish = __new_finish;
+		  _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
+		  std::fill(__pos, __pos + difference_type(__n), __x_copy);
+		}
+	      else
+		{
+		  std::__uninitialized_fill_move(this->_M_impl._M_finish,
+						 __pos + difference_type(__n),
+						 __x_copy, __pos,
+						 this->_M_impl._M_finish,
+						 _M_get_Tp_allocator());
+		  this->_M_impl._M_finish = __new_finish;
+		  std::fill(__pos, __old_finish, __x_copy);
+		}
+	    }
+	  __catch(...)
+	    {
+	      _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+			       __new_finish._M_node + 1);
+	      __throw_exception_again;
+	    }
+	}
+    }
+
+  template <typename _Tp, typename _Alloc>
+    template <typename _ForwardIterator>
+      void
+      deque<_Tp, _Alloc>::
+      _M_insert_aux(iterator __pos,
+                    _ForwardIterator __first, _ForwardIterator __last,
+                    size_type __n)
+      {
+        const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
+        const size_type __length = size();
+        if (static_cast<size_type>(__elemsbefore) < __length / 2)
+	  {
+	    iterator __new_start = _M_reserve_elements_at_front(__n);
+	    iterator __old_start = this->_M_impl._M_start;
+	    __pos = this->_M_impl._M_start + __elemsbefore;
+	    __try
+	      {
+		if (__elemsbefore >= difference_type(__n))
+		  {
+		    iterator __start_n = (this->_M_impl._M_start
+					  + difference_type(__n));
+		    std::__uninitialized_move_a(this->_M_impl._M_start,
+						__start_n, __new_start,
+						_M_get_Tp_allocator());
+		    this->_M_impl._M_start = __new_start;
+		    _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
+		    std::copy(__first, __last, __pos - difference_type(__n));
+		  }
+		else
+		  {
+		    _ForwardIterator __mid = __first;
+		    std::advance(__mid, difference_type(__n) - __elemsbefore);
+		    std::__uninitialized_move_copy(this->_M_impl._M_start,
+						   __pos, __first, __mid,
+						   __new_start,
+						   _M_get_Tp_allocator());
+		    this->_M_impl._M_start = __new_start;
+		    std::copy(__mid, __last, __old_start);
+		  }
+	      }
+	    __catch(...)
+	      {
+		_M_destroy_nodes(__new_start._M_node,
+				 this->_M_impl._M_start._M_node);
+		__throw_exception_again;
+	      }
+	  }
+        else
+        {
+          iterator __new_finish = _M_reserve_elements_at_back(__n);
+          iterator __old_finish = this->_M_impl._M_finish;
+          const difference_type __elemsafter =
+            difference_type(__length) - __elemsbefore;
+          __pos = this->_M_impl._M_finish - __elemsafter;
+          __try
+            {
+              if (__elemsafter > difference_type(__n))
+		{
+		  iterator __finish_n = (this->_M_impl._M_finish
+					 - difference_type(__n));
+		  std::__uninitialized_move_a(__finish_n,
+					      this->_M_impl._M_finish,
+					      this->_M_impl._M_finish,
+					      _M_get_Tp_allocator());
+		  this->_M_impl._M_finish = __new_finish;
+		  _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
+		  std::copy(__first, __last, __pos);
+		}
+              else
+		{
+		  _ForwardIterator __mid = __first;
+		  std::advance(__mid, __elemsafter);
+		  std::__uninitialized_copy_move(__mid, __last, __pos,
+						 this->_M_impl._M_finish,
+						 this->_M_impl._M_finish,
+						 _M_get_Tp_allocator());
+		  this->_M_impl._M_finish = __new_finish;
+		  std::copy(__first, __mid, __pos);
+		}
+            }
+          __catch(...)
+            {
+              _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+			       __new_finish._M_node + 1);
+              __throw_exception_again;
+            }
+        }
+      }
+
+   template<typename _Tp, typename _Alloc>
+     void
+     deque<_Tp, _Alloc>::
+     _M_destroy_data_aux(iterator __first, iterator __last)
+     {
+       for (_Map_pointer __node = __first._M_node + 1;
+	    __node < __last._M_node; ++__node)
+	 std::_Destroy(*__node, *__node + _S_buffer_size(),
+		       _M_get_Tp_allocator());
+
+       if (__first._M_node != __last._M_node)
+	 {
+	   std::_Destroy(__first._M_cur, __first._M_last,
+			 _M_get_Tp_allocator());
+	   std::_Destroy(__last._M_first, __last._M_cur,
+			 _M_get_Tp_allocator());
+	 }
+       else
+	 std::_Destroy(__first._M_cur, __last._M_cur,
+		       _M_get_Tp_allocator());
+     }
+
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_new_elements_at_front(size_type __new_elems)
+    {
+      if (this->max_size() - this->size() < __new_elems)
+	__throw_length_error(__N("deque::_M_new_elements_at_front"));
+
+      const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
+				     / _S_buffer_size());
+      _M_reserve_map_at_front(__new_nodes);
+      size_type __i;
+      __try
+        {
+          for (__i = 1; __i <= __new_nodes; ++__i)
+            *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
+        }
+      __catch(...)
+        {
+          for (size_type __j = 1; __j < __i; ++__j)
+            _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
+          __throw_exception_again;
+        }
+    }
+
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_new_elements_at_back(size_type __new_elems)
+    {
+      if (this->max_size() - this->size() < __new_elems)
+	__throw_length_error(__N("deque::_M_new_elements_at_back"));
+
+      const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
+				     / _S_buffer_size());
+      _M_reserve_map_at_back(__new_nodes);
+      size_type __i;
+      __try
+        {
+          for (__i = 1; __i <= __new_nodes; ++__i)
+            *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
+        }
+      __catch(...)
+        {
+          for (size_type __j = 1; __j < __i; ++__j)
+            _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
+          __throw_exception_again;
+        }
+    }
+
+  template <typename _Tp, typename _Alloc>
+    void
+    deque<_Tp, _Alloc>::
+    _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
+    {
+      const size_type __old_num_nodes
+	= this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
+      const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
+
+      _Map_pointer __new_nstart;
+      if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
+	{
+	  __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
+					 - __new_num_nodes) / 2
+	                 + (__add_at_front ? __nodes_to_add : 0);
+	  if (__new_nstart < this->_M_impl._M_start._M_node)
+	    std::copy(this->_M_impl._M_start._M_node,
+		      this->_M_impl._M_finish._M_node + 1,
+		      __new_nstart);
+	  else
+	    std::copy_backward(this->_M_impl._M_start._M_node,
+			       this->_M_impl._M_finish._M_node + 1,
+			       __new_nstart + __old_num_nodes);
+	}
+      else
+	{
+	  size_type __new_map_size = this->_M_impl._M_map_size
+	                             + std::max(this->_M_impl._M_map_size,
+						__nodes_to_add) + 2;
+
+	  _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
+	  __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+	                 + (__add_at_front ? __nodes_to_add : 0);
+	  std::copy(this->_M_impl._M_start._M_node,
+		    this->_M_impl._M_finish._M_node + 1,
+		    __new_nstart);
+	  _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+
+	  this->_M_impl._M_map = __new_map;
+	  this->_M_impl._M_map_size = __new_map_size;
+	}
+
+      this->_M_impl._M_start._M_set_node(__new_nstart);
+      this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
+    }
+
+  // Overload for deque::iterators, exploiting the "segmented-iterator
+  // optimization".
+  template<typename _Tp>
+    void
+    fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+	 const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value)
+    {
+      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+
+      for (typename _Self::_Map_pointer __node = __first._M_node + 1;
+           __node < __last._M_node; ++__node)
+	std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
+
+      if (__first._M_node != __last._M_node)
+	{
+	  std::fill(__first._M_cur, __first._M_last, __value);
+	  std::fill(__last._M_first, __last._M_cur, __value);
+	}
+      else
+	std::fill(__first._M_cur, __last._M_cur, __value);
+    }
+
+  template<typename _Tp>
+    _Deque_iterator<_Tp, _Tp&, _Tp*>
+    copy(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
+	 _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
+	 _Deque_iterator<_Tp, _Tp&, _Tp*> __result)
+    {
+      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+      typedef typename _Self::difference_type difference_type;
+
+      difference_type __len = __last - __first;
+      while (__len > 0)
+	{
+	  const difference_type __clen
+	    = std::min(__len, std::min(__first._M_last - __first._M_cur,
+				       __result._M_last - __result._M_cur));
+	  std::copy(__first._M_cur, __first._M_cur + __clen, __result._M_cur);
+	  __first += __clen;
+	  __result += __clen;
+	  __len -= __clen;
+	}
+      return __result;
+    }
+
+  template<typename _Tp>
+    _Deque_iterator<_Tp, _Tp&, _Tp*>
+    copy_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
+		  _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
+		  _Deque_iterator<_Tp, _Tp&, _Tp*> __result)
+    {
+      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+      typedef typename _Self::difference_type difference_type;
+
+      difference_type __len = __last - __first;
+      while (__len > 0)
+	{
+	  difference_type __llen = __last._M_cur - __last._M_first;
+	  _Tp* __lend = __last._M_cur;
+
+	  difference_type __rlen = __result._M_cur - __result._M_first;
+	  _Tp* __rend = __result._M_cur;
+
+	  if (!__llen)
+	    {
+	      __llen = _Self::_S_buffer_size();
+	      __lend = *(__last._M_node - 1) + __llen;
+	    }
+	  if (!__rlen)
+	    {
+	      __rlen = _Self::_S_buffer_size();
+	      __rend = *(__result._M_node - 1) + __rlen;
+	    }
+
+	  const difference_type __clen = std::min(__len,
+						  std::min(__llen, __rlen));
+	  std::copy_backward(__lend - __clen, __lend, __rend);
+	  __last -= __clen;
+	  __result -= __clen;
+	  __len -= __clen;
+	}
+      return __result;
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _Tp>
+    _Deque_iterator<_Tp, _Tp&, _Tp*>
+    move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
+	 _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
+	 _Deque_iterator<_Tp, _Tp&, _Tp*> __result)
+    {
+      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+      typedef typename _Self::difference_type difference_type;
+
+      difference_type __len = __last - __first;
+      while (__len > 0)
+	{
+	  const difference_type __clen
+	    = std::min(__len, std::min(__first._M_last - __first._M_cur,
+				       __result._M_last - __result._M_cur));
+	  std::move(__first._M_cur, __first._M_cur + __clen, __result._M_cur);
+	  __first += __clen;
+	  __result += __clen;
+	  __len -= __clen;
+	}
+      return __result;
+    }
+
+  template<typename _Tp>
+    _Deque_iterator<_Tp, _Tp&, _Tp*>
+    move_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
+		  _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
+		  _Deque_iterator<_Tp, _Tp&, _Tp*> __result)
+    {
+      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+      typedef typename _Self::difference_type difference_type;
+
+      difference_type __len = __last - __first;
+      while (__len > 0)
+	{
+	  difference_type __llen = __last._M_cur - __last._M_first;
+	  _Tp* __lend = __last._M_cur;
+
+	  difference_type __rlen = __result._M_cur - __result._M_first;
+	  _Tp* __rend = __result._M_cur;
+
+	  if (!__llen)
+	    {
+	      __llen = _Self::_S_buffer_size();
+	      __lend = *(__last._M_node - 1) + __llen;
+	    }
+	  if (!__rlen)
+	    {
+	      __rlen = _Self::_S_buffer_size();
+	      __rend = *(__result._M_node - 1) + __rlen;
+	    }
+
+	  const difference_type __clen = std::min(__len,
+						  std::min(__llen, __rlen));
+	  std::move_backward(__lend - __clen, __lend, __rend);
+	  __last -= __clen;
+	  __result -= __clen;
+	  __len -= __clen;
+	}
+      return __result;
+    }
+#endif
+
+_GLIBCXX_END_NAMESPACE_CONTAINER
+} // namespace std
+
+#endif

+ 312 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/enable_special_members.h

@@ -0,0 +1,312 @@
+// <bits/enable_special_members.h> -*- C++ -*-
+
+// Copyright (C) 2013-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/enable_special_members.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly.
+ */
+
+#ifndef _ENABLE_SPECIAL_MEMBERS_H
+#define _ENABLE_SPECIAL_MEMBERS_H 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  struct _Enable_default_constructor_tag
+  {
+    explicit constexpr _Enable_default_constructor_tag() = default;
+  };
+
+/**
+  * @brief A mixin helper to conditionally enable or disable the default
+  * constructor.
+  * @sa _Enable_special_members
+  */
+template<bool _Switch, typename _Tag = void>
+  struct _Enable_default_constructor
+  {
+    constexpr _Enable_default_constructor() noexcept = default;
+    constexpr _Enable_default_constructor(_Enable_default_constructor const&)
+      noexcept  = default;
+    constexpr _Enable_default_constructor(_Enable_default_constructor&&)
+      noexcept = default;
+    _Enable_default_constructor&
+    operator=(_Enable_default_constructor const&) noexcept = default;
+    _Enable_default_constructor&
+    operator=(_Enable_default_constructor&&) noexcept = default;
+
+    // Can be used in other ctors.
+    constexpr explicit
+    _Enable_default_constructor(_Enable_default_constructor_tag) { }
+  };
+
+
+/**
+  * @brief A mixin helper to conditionally enable or disable the default
+  * destructor.
+  * @sa _Enable_special_members
+  */
+template<bool _Switch, typename _Tag = void>
+  struct _Enable_destructor { };
+
+/**
+  * @brief A mixin helper to conditionally enable or disable the copy/move
+  * special members.
+  * @sa _Enable_special_members
+  */
+template<bool _Copy, bool _CopyAssignment,
+         bool _Move, bool _MoveAssignment,
+         typename _Tag = void>
+  struct _Enable_copy_move { };
+
+/**
+  * @brief A mixin helper to conditionally enable or disable the special
+  * members.
+  *
+  * The @c _Tag type parameter is to make mixin bases unique and thus avoid
+  * ambiguities.
+  */
+template<bool _Default, bool _Destructor,
+         bool _Copy, bool _CopyAssignment,
+         bool _Move, bool _MoveAssignment,
+         typename _Tag = void>
+  struct _Enable_special_members
+  : private _Enable_default_constructor<_Default, _Tag>,
+    private _Enable_destructor<_Destructor, _Tag>,
+    private _Enable_copy_move<_Copy, _CopyAssignment,
+                              _Move, _MoveAssignment,
+                              _Tag>
+  { };
+
+// Boilerplate follows.
+
+template<typename _Tag>
+  struct _Enable_default_constructor<false, _Tag>
+  {
+    constexpr _Enable_default_constructor() noexcept = delete;
+    constexpr _Enable_default_constructor(_Enable_default_constructor const&)
+      noexcept  = default;
+    constexpr _Enable_default_constructor(_Enable_default_constructor&&)
+      noexcept = default;
+    _Enable_default_constructor&
+    operator=(_Enable_default_constructor const&) noexcept = default;
+    _Enable_default_constructor&
+    operator=(_Enable_default_constructor&&) noexcept = default;
+
+    // Can be used in other ctors.
+    constexpr explicit
+    _Enable_default_constructor(_Enable_default_constructor_tag) { }
+  };
+
+template<typename _Tag>
+  struct _Enable_destructor<false, _Tag>
+  { ~_Enable_destructor() noexcept = delete; };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, true, true, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, false, true, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, false, true, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, true, false, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, true, false, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, false, false, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, false, false, true, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = default;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, true, true, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, true, true, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, false, true, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, false, true, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, true, false, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, true, false, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = default;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<true, false, false, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = default;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+template<typename _Tag>
+  struct _Enable_copy_move<false, false, false, false, _Tag>
+  {
+    constexpr _Enable_copy_move() noexcept                          = default;
+    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
+    constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept       = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move const&) noexcept                    = delete;
+    _Enable_copy_move&
+    operator=(_Enable_copy_move&&) noexcept                         = delete;
+  };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif // _ENABLE_SPECIAL_MEMBERS_H

+ 78 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/exception.h

@@ -0,0 +1,78 @@
+// Exception Handling support header for -*- C++ -*-
+
+// Copyright (C) 2016-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/exception.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly.
+ */
+
+#ifndef __EXCEPTION_H
+#define __EXCEPTION_H 1
+
+#pragma GCC system_header
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+
+extern "C++" {
+
+namespace std
+{
+  /**
+   * @defgroup exceptions Exceptions
+   * @ingroup diagnostics
+   *
+   * Classes and functions for reporting errors via exception classes.
+   * @{
+   */
+
+  /**
+   *  @brief Base class for all library exceptions.
+   *
+   *  This is the base class for all exceptions thrown by the standard
+   *  library, and by certain language expressions.  You are free to derive
+   *  your own %exception classes, or use a different hierarchy, or to
+   *  throw non-class data (e.g., fundamental types).
+   */
+  class exception
+  {
+  public:
+    exception() _GLIBCXX_USE_NOEXCEPT { }
+    virtual ~exception() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
+
+    /** Returns a C-style character string describing the general cause
+     *  of the current error.  */
+    virtual const char*
+    what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
+  };
+
+} // namespace std
+
+}
+
+#pragma GCC visibility pop
+
+#endif

+ 45 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/exception_defines.h

@@ -0,0 +1,45 @@
+// -fno-exceptions Support -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/exception_defines.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{exception}
+ */
+
+#ifndef _EXCEPTION_DEFINES_H
+#define _EXCEPTION_DEFINES_H 1
+
+#if ! __cpp_exceptions
+// Iff -fno-exceptions, transform error handling code to work without it.
+# define __try      if (true)
+# define __catch(X) if (false)
+# define __throw_exception_again
+#else
+// Else proceed normally.
+# define __try      try
+# define __catch(X) catch(X)
+# define __throw_exception_again throw
+#endif
+
+#endif

+ 230 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/exception_ptr.h

@@ -0,0 +1,230 @@
+// Exception Handling support header (exception_ptr class) for -*- C++ -*-
+
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+// 
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/exception_ptr.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{exception}
+ */
+
+#ifndef _EXCEPTION_PTR_H
+#define _EXCEPTION_PTR_H
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+#include <bits/exception_defines.h>
+#include <bits/cxxabi_init_exception.h>
+#include <typeinfo>
+#include <new>
+
+extern "C++" {
+
+namespace std 
+{
+  class type_info;
+
+  /**
+   * @addtogroup exceptions
+   * @{
+   */
+  namespace __exception_ptr
+  {
+    class exception_ptr;
+  }
+
+  using __exception_ptr::exception_ptr;
+
+  /** Obtain an exception_ptr to the currently handled exception. If there
+   *  is none, or the currently handled exception is foreign, return the null
+   *  value.
+   */
+  exception_ptr current_exception() _GLIBCXX_USE_NOEXCEPT;
+
+  template<typename _Ex>
+  exception_ptr make_exception_ptr(_Ex) _GLIBCXX_USE_NOEXCEPT;
+
+  /// Throw the object pointed to by the exception_ptr.
+  void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
+
+  namespace __exception_ptr
+  {
+    using std::rethrow_exception;
+
+    /**
+     *  @brief An opaque pointer to an arbitrary exception.
+     *  @ingroup exceptions
+     */
+    class exception_ptr
+    {
+      void* _M_exception_object;
+
+      explicit exception_ptr(void* __e) _GLIBCXX_USE_NOEXCEPT;
+
+      void _M_addref() _GLIBCXX_USE_NOEXCEPT;
+      void _M_release() _GLIBCXX_USE_NOEXCEPT;
+
+      void *_M_get() const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
+
+      friend exception_ptr std::current_exception() _GLIBCXX_USE_NOEXCEPT;
+      friend void std::rethrow_exception(exception_ptr);
+      template<typename _Ex>
+      friend exception_ptr std::make_exception_ptr(_Ex) _GLIBCXX_USE_NOEXCEPT;
+
+    public:
+      exception_ptr() _GLIBCXX_USE_NOEXCEPT;
+
+      exception_ptr(const exception_ptr&) _GLIBCXX_USE_NOEXCEPT;
+
+#if __cplusplus >= 201103L
+      exception_ptr(nullptr_t) noexcept
+      : _M_exception_object(0)
+      { }
+
+      exception_ptr(exception_ptr&& __o) noexcept
+      : _M_exception_object(__o._M_exception_object)
+      { __o._M_exception_object = 0; }
+#endif
+
+#if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT)
+      typedef void (exception_ptr::*__safe_bool)();
+
+      // For construction from nullptr or 0.
+      exception_ptr(__safe_bool) _GLIBCXX_USE_NOEXCEPT;
+#endif
+
+      exception_ptr& 
+      operator=(const exception_ptr&) _GLIBCXX_USE_NOEXCEPT;
+
+#if __cplusplus >= 201103L
+      exception_ptr& 
+      operator=(exception_ptr&& __o) noexcept
+      {
+        exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
+        return *this;
+      }
+#endif
+
+      ~exception_ptr() _GLIBCXX_USE_NOEXCEPT;
+
+      void 
+      swap(exception_ptr&) _GLIBCXX_USE_NOEXCEPT;
+
+#ifdef _GLIBCXX_EH_PTR_COMPAT
+      // Retained for compatibility with CXXABI_1.3.
+      void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
+	__attribute__ ((__const__));
+      bool operator!() const _GLIBCXX_USE_NOEXCEPT
+	__attribute__ ((__pure__));
+      operator __safe_bool() const _GLIBCXX_USE_NOEXCEPT;
+#endif
+
+#if __cplusplus >= 201103L
+      explicit operator bool() const
+      { return _M_exception_object; }
+#endif
+
+      friend bool 
+      operator==(const exception_ptr&, const exception_ptr&)
+	_GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
+
+      const class std::type_info*
+      __cxa_exception_type() const _GLIBCXX_USE_NOEXCEPT
+	__attribute__ ((__pure__));
+    };
+
+    bool 
+    operator==(const exception_ptr&, const exception_ptr&)
+      _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
+
+    bool 
+    operator!=(const exception_ptr&, const exception_ptr&)
+      _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
+
+    inline void
+    swap(exception_ptr& __lhs, exception_ptr& __rhs)
+    { __lhs.swap(__rhs); }
+
+    template<typename _Ex>
+      inline void
+      __dest_thunk(void* __x)
+      { static_cast<_Ex*>(__x)->~_Ex(); }
+
+  } // namespace __exception_ptr
+
+  /// Obtain an exception_ptr pointing to a copy of the supplied object.
+  template<typename _Ex>
+    exception_ptr 
+    make_exception_ptr(_Ex __ex) _GLIBCXX_USE_NOEXCEPT
+    {
+#if __cpp_exceptions && __cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI
+      void* __e = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ex));
+      (void) __cxxabiv1::__cxa_init_primary_exception(
+	  __e, const_cast<std::type_info*>(&typeid(__ex)),
+	  __exception_ptr::__dest_thunk<_Ex>);
+      try
+	{
+          ::new (__e) _Ex(__ex);
+          return exception_ptr(__e);
+	}
+      catch(...)
+	{
+	  __cxxabiv1::__cxa_free_exception(__e);
+	  return current_exception();
+	}
+#elif __cpp_exceptions
+      try
+	{
+          throw __ex;
+	}
+      catch(...)
+	{
+	  return current_exception();
+	}
+#else // no RTTI and no exceptions
+      return exception_ptr();
+#endif
+    }
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 1130. copy_exception name misleading
+  /// Obtain an exception_ptr pointing to a copy of the supplied object.
+  /// This function is deprecated, use std::make_exception_ptr instead.
+  template<typename _Ex>
+    exception_ptr
+    copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT _GLIBCXX_DEPRECATED;
+
+  template<typename _Ex>
+    exception_ptr
+    copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT
+    { return std::make_exception_ptr<_Ex>(__ex); }
+
+  // @} group exceptions
+} // namespace std
+
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#endif

+ 1432 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/forward_list.h

@@ -0,0 +1,1432 @@
+// <forward_list.h> -*- C++ -*-
+
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/forward_list.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{forward_list}
+ */
+
+#ifndef _FORWARD_LIST_H
+#define _FORWARD_LIST_H 1
+
+#pragma GCC system_header
+
+#include <initializer_list>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator.h>
+#include <bits/stl_algobase.h>
+#include <bits/stl_function.h>
+#include <bits/allocator.h>
+#include <ext/alloc_traits.h>
+#include <ext/aligned_buffer.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+
+  /**
+   *  @brief  A helper basic node class for %forward_list.
+   *          This is just a linked list with nothing inside it.
+   *          There are purely list shuffling utility methods here.
+   */
+  struct _Fwd_list_node_base
+  {
+    _Fwd_list_node_base() = default;
+
+    _Fwd_list_node_base* _M_next = nullptr;
+
+    _Fwd_list_node_base*
+    _M_transfer_after(_Fwd_list_node_base* __begin,
+		      _Fwd_list_node_base* __end) noexcept
+    {
+      _Fwd_list_node_base* __keep = __begin->_M_next;
+      if (__end)
+	{
+	  __begin->_M_next = __end->_M_next;
+	  __end->_M_next = _M_next;
+	}
+      else
+	__begin->_M_next = 0;
+      _M_next = __keep;
+      return __end;
+    }
+
+    void
+    _M_reverse_after() noexcept
+    {
+      _Fwd_list_node_base* __tail = _M_next;
+      if (!__tail)
+	return;
+      while (_Fwd_list_node_base* __temp = __tail->_M_next)
+	{
+	  _Fwd_list_node_base* __keep = _M_next;
+	  _M_next = __temp;
+	  __tail->_M_next = __temp->_M_next;
+	  _M_next->_M_next = __keep;
+	}
+    }
+  };
+
+  /**
+   *  @brief  A helper node class for %forward_list.
+   *          This is just a linked list with uninitialized storage for a
+   *          data value in each node.
+   *          There is a sorting utility method.
+   */
+  template<typename _Tp>
+    struct _Fwd_list_node
+    : public _Fwd_list_node_base
+    {
+      _Fwd_list_node() = default;
+
+      __gnu_cxx::__aligned_buffer<_Tp> _M_storage;
+
+      _Tp*
+      _M_valptr() noexcept
+      { return _M_storage._M_ptr(); }
+
+      const _Tp*
+      _M_valptr() const noexcept
+      { return _M_storage._M_ptr(); }
+    };
+
+  /**
+   *   @brief A forward_list::iterator.
+   * 
+   *   All the functions are op overloads.
+   */
+  template<typename _Tp>
+    struct _Fwd_list_iterator
+    {
+      typedef _Fwd_list_iterator<_Tp>            _Self;
+      typedef _Fwd_list_node<_Tp>                _Node;
+
+      typedef _Tp                                value_type;
+      typedef _Tp*                               pointer;
+      typedef _Tp&                               reference;
+      typedef ptrdiff_t                          difference_type;
+      typedef std::forward_iterator_tag          iterator_category;
+
+      _Fwd_list_iterator() noexcept
+      : _M_node() { }
+
+      explicit
+      _Fwd_list_iterator(_Fwd_list_node_base* __n) noexcept
+      : _M_node(__n) { }
+
+      reference
+      operator*() const noexcept
+      { return *static_cast<_Node*>(this->_M_node)->_M_valptr(); }
+
+      pointer
+      operator->() const noexcept
+      { return static_cast<_Node*>(this->_M_node)->_M_valptr(); }
+
+      _Self&
+      operator++() noexcept
+      {
+        _M_node = _M_node->_M_next;
+        return *this;
+      }
+
+      _Self
+      operator++(int) noexcept
+      {
+        _Self __tmp(*this);
+        _M_node = _M_node->_M_next;
+        return __tmp;
+      }
+
+      bool
+      operator==(const _Self& __x) const noexcept
+      { return _M_node == __x._M_node; }
+
+      bool
+      operator!=(const _Self& __x) const noexcept
+      { return _M_node != __x._M_node; }
+
+      _Self
+      _M_next() const noexcept
+      {
+        if (_M_node)
+          return _Fwd_list_iterator(_M_node->_M_next);
+        else
+          return _Fwd_list_iterator(0);
+      }
+
+      _Fwd_list_node_base* _M_node;
+    };
+
+  /**
+   *   @brief A forward_list::const_iterator.
+   * 
+   *   All the functions are op overloads.
+   */
+  template<typename _Tp>
+    struct _Fwd_list_const_iterator
+    {
+      typedef _Fwd_list_const_iterator<_Tp>      _Self;
+      typedef const _Fwd_list_node<_Tp>          _Node;
+      typedef _Fwd_list_iterator<_Tp>            iterator;
+
+      typedef _Tp                                value_type;
+      typedef const _Tp*                         pointer;
+      typedef const _Tp&                         reference;
+      typedef ptrdiff_t                          difference_type;
+      typedef std::forward_iterator_tag          iterator_category;
+
+      _Fwd_list_const_iterator() noexcept
+      : _M_node() { }
+
+      explicit
+      _Fwd_list_const_iterator(const _Fwd_list_node_base* __n)  noexcept
+      : _M_node(__n) { }
+
+      _Fwd_list_const_iterator(const iterator& __iter) noexcept
+      : _M_node(__iter._M_node) { }
+
+      reference
+      operator*() const noexcept
+      { return *static_cast<_Node*>(this->_M_node)->_M_valptr(); }
+
+      pointer
+      operator->() const noexcept
+      { return static_cast<_Node*>(this->_M_node)->_M_valptr(); }
+
+      _Self&
+      operator++() noexcept
+      {
+        _M_node = _M_node->_M_next;
+        return *this;
+      }
+
+      _Self
+      operator++(int) noexcept
+      {
+        _Self __tmp(*this);
+        _M_node = _M_node->_M_next;
+        return __tmp;
+      }
+
+      bool
+      operator==(const _Self& __x) const noexcept
+      { return _M_node == __x._M_node; }
+
+      bool
+      operator!=(const _Self& __x) const noexcept
+      { return _M_node != __x._M_node; }
+
+      _Self
+      _M_next() const noexcept
+      {
+        if (this->_M_node)
+          return _Fwd_list_const_iterator(_M_node->_M_next);
+        else
+          return _Fwd_list_const_iterator(0);
+      }
+
+      const _Fwd_list_node_base* _M_node;
+    };
+
+  /**
+   *  @brief  Forward list iterator equality comparison.
+   */
+  template<typename _Tp>
+    inline bool
+    operator==(const _Fwd_list_iterator<_Tp>& __x,
+               const _Fwd_list_const_iterator<_Tp>& __y) noexcept
+    { return __x._M_node == __y._M_node; }
+
+  /**
+   *  @brief  Forward list iterator inequality comparison.
+   */
+  template<typename _Tp>
+    inline bool
+    operator!=(const _Fwd_list_iterator<_Tp>& __x,
+               const _Fwd_list_const_iterator<_Tp>& __y) noexcept
+    { return __x._M_node != __y._M_node; }
+
+  /**
+   *  @brief  Base class for %forward_list.
+   */
+  template<typename _Tp, typename _Alloc>
+    struct _Fwd_list_base
+    {
+    protected:
+      typedef __alloc_rebind<_Alloc, _Fwd_list_node<_Tp>> _Node_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Node_alloc_type> _Node_alloc_traits;
+
+      struct _Fwd_list_impl 
+      : public _Node_alloc_type
+      {
+        _Fwd_list_node_base _M_head;
+
+        _Fwd_list_impl()
+        : _Node_alloc_type(), _M_head()
+        { }
+
+        _Fwd_list_impl(const _Node_alloc_type& __a)
+        : _Node_alloc_type(__a), _M_head()
+        { }
+
+        _Fwd_list_impl(_Node_alloc_type&& __a)
+	: _Node_alloc_type(std::move(__a)), _M_head()
+        { }
+      };
+
+      _Fwd_list_impl _M_impl;
+
+    public:
+      typedef _Fwd_list_iterator<_Tp>                 iterator;
+      typedef _Fwd_list_const_iterator<_Tp>           const_iterator;
+      typedef _Fwd_list_node<_Tp>                     _Node;
+
+      _Node_alloc_type&
+      _M_get_Node_allocator() noexcept
+      { return this->_M_impl; }
+
+      const _Node_alloc_type&
+      _M_get_Node_allocator() const noexcept
+      { return this->_M_impl; }
+
+      _Fwd_list_base()
+      : _M_impl() { }
+
+      _Fwd_list_base(_Node_alloc_type&& __a)
+      : _M_impl(std::move(__a)) { }
+
+      _Fwd_list_base(_Fwd_list_base&& __lst, _Node_alloc_type&& __a);
+
+      _Fwd_list_base(_Fwd_list_base&& __lst)
+      : _M_impl(std::move(__lst._M_get_Node_allocator()))
+      {
+	this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next;
+	__lst._M_impl._M_head._M_next = 0;
+      }
+
+      ~_Fwd_list_base()
+      { _M_erase_after(&_M_impl._M_head, 0); }
+
+    protected:
+
+      _Node*
+      _M_get_node()
+      {
+	auto __ptr = _Node_alloc_traits::allocate(_M_get_Node_allocator(), 1);
+	return std::__addressof(*__ptr);
+      }
+
+      template<typename... _Args>
+        _Node*
+        _M_create_node(_Args&&... __args)
+        {
+          _Node* __node = this->_M_get_node();
+          __try
+            {
+	      ::new ((void*)__node) _Node;
+	      _Node_alloc_traits::construct(_M_get_Node_allocator(),
+					    __node->_M_valptr(),
+					    std::forward<_Args>(__args)...);
+            }
+          __catch(...)
+            {
+              this->_M_put_node(__node);
+              __throw_exception_again;
+            }
+          return __node;
+        }
+
+      template<typename... _Args>
+        _Fwd_list_node_base*
+        _M_insert_after(const_iterator __pos, _Args&&... __args);
+
+      void
+      _M_put_node(_Node* __p)
+      {
+	typedef typename _Node_alloc_traits::pointer _Ptr;
+	auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__p);
+	_Node_alloc_traits::deallocate(_M_get_Node_allocator(), __ptr, 1);
+      }
+
+      _Fwd_list_node_base*
+      _M_erase_after(_Fwd_list_node_base* __pos);
+
+      _Fwd_list_node_base*
+      _M_erase_after(_Fwd_list_node_base* __pos, 
+                     _Fwd_list_node_base* __last);
+    };
+
+  /**
+   *  @brief A standard container with linear time access to elements,
+   *  and fixed time insertion/deletion at any point in the sequence.
+   *
+   *  @ingroup sequences
+   *
+   *  @tparam _Tp  Type of element.
+   *  @tparam _Alloc  Allocator type, defaults to allocator<_Tp>.
+   *
+   *  Meets the requirements of a <a href="tables.html#65">container</a>, a
+   *  <a href="tables.html#67">sequence</a>, including the
+   *  <a href="tables.html#68">optional sequence requirements</a> with the
+   *  %exception of @c at and @c operator[].
+   *
+   *  This is a @e singly @e linked %list.  Traversal up the
+   *  %list requires linear time, but adding and removing elements (or
+   *  @e nodes) is done in constant time, regardless of where the
+   *  change takes place.  Unlike std::vector and std::deque,
+   *  random-access iterators are not provided, so subscripting ( @c
+   *  [] ) access is not allowed.  For algorithms which only need
+   *  sequential access, this lack makes no difference.
+   *
+   *  Also unlike the other standard containers, std::forward_list provides
+   *  specialized algorithms %unique to linked lists, such as
+   *  splicing, sorting, and in-place reversal.
+   */
+  template<typename _Tp, typename _Alloc = allocator<_Tp> >
+    class forward_list : private _Fwd_list_base<_Tp, _Alloc>
+    {
+    private:
+      typedef _Fwd_list_base<_Tp, _Alloc>                  _Base;
+      typedef _Fwd_list_node<_Tp>                          _Node;
+      typedef _Fwd_list_node_base                          _Node_base;
+      typedef typename _Base::_Node_alloc_type             _Node_alloc_type;
+      typedef typename _Base::_Node_alloc_traits           _Node_alloc_traits;
+      typedef allocator_traits<__alloc_rebind<_Alloc, _Tp>>    _Alloc_traits;
+
+    public:
+      // types:
+      typedef _Tp                                          value_type;
+      typedef typename _Alloc_traits::pointer              pointer;
+      typedef typename _Alloc_traits::const_pointer        const_pointer;
+      typedef value_type&				   reference;
+      typedef const value_type&				   const_reference;
+ 
+      typedef _Fwd_list_iterator<_Tp>                      iterator;
+      typedef _Fwd_list_const_iterator<_Tp>                const_iterator;
+      typedef std::size_t                                  size_type;
+      typedef std::ptrdiff_t                               difference_type;
+      typedef _Alloc                                       allocator_type;
+
+      // 23.3.4.2 construct/copy/destroy:
+
+      /**
+       *  @brief  Creates a %forward_list with no elements.
+       */
+      forward_list()
+      noexcept(is_nothrow_default_constructible<_Node_alloc_type>::value)
+      : _Base()
+      { }
+
+      /**
+       *  @brief  Creates a %forward_list with no elements.
+       *  @param  __al  An allocator object.
+       */
+      explicit
+      forward_list(const _Alloc& __al) noexcept
+      : _Base(_Node_alloc_type(__al))
+      { }
+
+
+      /**
+       *  @brief  Copy constructor with allocator argument.
+       *  @param  __list  Input list to copy.
+       *  @param  __al    An allocator object.
+       */
+      forward_list(const forward_list& __list, const _Alloc& __al)
+      : _Base(_Node_alloc_type(__al))
+      { _M_range_initialize(__list.begin(), __list.end()); }
+
+      /**
+       *  @brief  Move constructor with allocator argument.
+       *  @param  __list  Input list to move.
+       *  @param  __al    An allocator object.
+       */
+      forward_list(forward_list&& __list, const _Alloc& __al)
+      noexcept(_Node_alloc_traits::_S_always_equal())
+      : _Base(std::move(__list), _Node_alloc_type(__al))
+      {
+	// If __list is not empty it means its allocator is not equal to __a,
+	// so we need to move from each element individually.
+	insert_after(cbefore_begin(),
+		     std::__make_move_if_noexcept_iterator(__list.begin()),
+		     std::__make_move_if_noexcept_iterator(__list.end()));
+      }
+
+      /**
+       *  @brief  Creates a %forward_list with default constructed elements.
+       *  @param  __n   The number of elements to initially create.
+       *  @param  __al  An allocator object.
+       *
+       *  This constructor creates the %forward_list with @a __n default
+       *  constructed elements.
+       */
+      explicit
+      forward_list(size_type __n, const _Alloc& __al = _Alloc())
+      : _Base(_Node_alloc_type(__al))
+      { _M_default_initialize(__n); }
+
+      /**
+       *  @brief  Creates a %forward_list with copies of an exemplar element.
+       *  @param  __n      The number of elements to initially create.
+       *  @param  __value  An element to copy.
+       *  @param  __al     An allocator object.
+       *
+       *  This constructor fills the %forward_list with @a __n copies of
+       *  @a __value.
+       */
+      forward_list(size_type __n, const _Tp& __value,
+                   const _Alloc& __al = _Alloc())
+      : _Base(_Node_alloc_type(__al))
+      { _M_fill_initialize(__n, __value); }
+
+      /**
+       *  @brief  Builds a %forward_list from a range.
+       *  @param  __first  An input iterator.
+       *  @param  __last   An input iterator.
+       *  @param  __al     An allocator object.
+       *
+       *  Create a %forward_list consisting of copies of the elements from
+       *  [@a __first,@a __last).  This is linear in N (where N is
+       *  distance(@a __first,@a __last)).
+       */
+      template<typename _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+        forward_list(_InputIterator __first, _InputIterator __last,
+                     const _Alloc& __al = _Alloc())
+	: _Base(_Node_alloc_type(__al))
+        { _M_range_initialize(__first, __last); }
+
+      /**
+       *  @brief  The %forward_list copy constructor.
+       *  @param  __list  A %forward_list of identical element and allocator
+       *                  types.
+       */
+      forward_list(const forward_list& __list)
+      : _Base(_Node_alloc_traits::_S_select_on_copy(
+                __list._M_get_Node_allocator()))
+      { _M_range_initialize(__list.begin(), __list.end()); }
+
+      /**
+       *  @brief  The %forward_list move constructor.
+       *  @param  __list  A %forward_list of identical element and allocator
+       *                  types.
+       *
+       *  The newly-created %forward_list contains the exact contents of @a
+       *  __list. The contents of @a __list are a valid, but unspecified
+       *  %forward_list.
+       */
+      forward_list(forward_list&& __list) noexcept
+      : _Base(std::move(__list)) { }
+
+      /**
+       *  @brief  Builds a %forward_list from an initializer_list
+       *  @param  __il  An initializer_list of value_type.
+       *  @param  __al  An allocator object.
+       *
+       *  Create a %forward_list consisting of copies of the elements
+       *  in the initializer_list @a __il.  This is linear in __il.size().
+       */
+      forward_list(std::initializer_list<_Tp> __il,
+                   const _Alloc& __al = _Alloc())
+      : _Base(_Node_alloc_type(__al))
+      { _M_range_initialize(__il.begin(), __il.end()); }
+
+      /**
+       *  @brief  The forward_list dtor.
+       */
+      ~forward_list() noexcept
+      { }
+
+      /**
+       *  @brief  The %forward_list assignment operator.
+       *  @param  __list  A %forward_list of identical element and allocator
+       *                types.
+       *
+       *  All the elements of @a __list are copied.
+       *
+       *  Whether the allocator is copied depends on the allocator traits.
+       */
+      forward_list&
+      operator=(const forward_list& __list);
+
+      /**
+       *  @brief  The %forward_list move assignment operator.
+       *  @param  __list  A %forward_list of identical element and allocator
+       *                types.
+       *
+       *  The contents of @a __list are moved into this %forward_list
+       *  (without copying, if the allocators permit it).
+       *
+       *  Afterwards @a __list is a valid, but unspecified %forward_list
+       *
+       *  Whether the allocator is moved depends on the allocator traits.
+       */
+      forward_list&
+      operator=(forward_list&& __list)
+      noexcept(_Node_alloc_traits::_S_nothrow_move())
+      {
+        constexpr bool __move_storage =
+          _Node_alloc_traits::_S_propagate_on_move_assign()
+          || _Node_alloc_traits::_S_always_equal();
+        _M_move_assign(std::move(__list), __bool_constant<__move_storage>());
+	return *this;
+      }
+
+      /**
+       *  @brief  The %forward_list initializer list assignment operator.
+       *  @param  __il  An initializer_list of value_type.
+       *
+       *  Replace the contents of the %forward_list with copies of the
+       *  elements in the initializer_list @a __il.  This is linear in
+       *  __il.size().
+       */
+      forward_list&
+      operator=(std::initializer_list<_Tp> __il)
+      {
+        assign(__il);
+        return *this;
+      }
+
+      /**
+       *  @brief  Assigns a range to a %forward_list.
+       *  @param  __first  An input iterator.
+       *  @param  __last   An input iterator.
+       *
+       *  This function fills a %forward_list with copies of the elements
+       *  in the range [@a __first,@a __last).
+       *
+       *  Note that the assignment completely changes the %forward_list and
+       *  that the number of elements of the resulting %forward_list is the
+       *  same as the number of elements assigned.
+       */
+      template<typename _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+	void
+        assign(_InputIterator __first, _InputIterator __last)
+        {
+	  typedef is_assignable<_Tp, decltype(*__first)> __assignable;
+	  _M_assign(__first, __last, __assignable());
+	}
+
+      /**
+       *  @brief  Assigns a given value to a %forward_list.
+       *  @param  __n  Number of elements to be assigned.
+       *  @param  __val  Value to be assigned.
+       *
+       *  This function fills a %forward_list with @a __n copies of the
+       *  given value.  Note that the assignment completely changes the
+       *  %forward_list, and that the resulting %forward_list has __n
+       *  elements.
+       */
+      void
+      assign(size_type __n, const _Tp& __val)
+      { _M_assign_n(__n, __val, is_copy_assignable<_Tp>()); }
+
+      /**
+       *  @brief  Assigns an initializer_list to a %forward_list.
+       *  @param  __il  An initializer_list of value_type.
+       *
+       *  Replace the contents of the %forward_list with copies of the
+       *  elements in the initializer_list @a __il.  This is linear in
+       *  il.size().
+       */
+      void
+      assign(std::initializer_list<_Tp> __il)
+      { assign(__il.begin(), __il.end()); }
+
+      /// Get a copy of the memory allocation object.
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(this->_M_get_Node_allocator()); }
+
+      // 23.3.4.3 iterators:
+
+      /**
+       *  Returns a read/write iterator that points before the first element
+       *  in the %forward_list.  Iteration is done in ordinary element order.
+       */
+      iterator
+      before_begin() noexcept
+      { return iterator(&this->_M_impl._M_head); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points before the
+       *  first element in the %forward_list.  Iteration is done in ordinary
+       *  element order.
+       */
+      const_iterator
+      before_begin() const noexcept
+      { return const_iterator(&this->_M_impl._M_head); }
+
+      /**
+       *  Returns a read/write iterator that points to the first element
+       *  in the %forward_list.  Iteration is done in ordinary element order.
+       */
+      iterator
+      begin() noexcept
+      { return iterator(this->_M_impl._M_head._M_next); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points to the first
+       *  element in the %forward_list.  Iteration is done in ordinary
+       *  element order.
+       */
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(this->_M_impl._M_head._M_next); }
+
+      /**
+       *  Returns a read/write iterator that points one past the last
+       *  element in the %forward_list.  Iteration is done in ordinary
+       *  element order.
+       */
+      iterator
+      end() noexcept
+      { return iterator(0); }
+
+      /**
+       *  Returns a read-only iterator that points one past the last
+       *  element in the %forward_list.  Iteration is done in ordinary
+       *  element order.
+       */
+      const_iterator
+      end() const noexcept
+      { return const_iterator(0); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points to the
+       *  first element in the %forward_list.  Iteration is done in ordinary
+       *  element order.
+       */
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_impl._M_head._M_next); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points before the
+       *  first element in the %forward_list.  Iteration is done in ordinary
+       *  element order.
+       */
+      const_iterator
+      cbefore_begin() const noexcept
+      { return const_iterator(&this->_M_impl._M_head); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points one past
+       *  the last element in the %forward_list.  Iteration is done in
+       *  ordinary element order.
+       */
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(0); }
+
+      /**
+       *  Returns true if the %forward_list is empty.  (Thus begin() would
+       *  equal end().)
+       */
+      bool
+      empty() const noexcept
+      { return this->_M_impl._M_head._M_next == 0; }
+
+      /**
+       *  Returns the largest possible number of elements of %forward_list.
+       */
+      size_type
+      max_size() const noexcept
+      { return _Node_alloc_traits::max_size(this->_M_get_Node_allocator()); }
+
+      // 23.3.4.4 element access:
+
+      /**
+       *  Returns a read/write reference to the data at the first
+       *  element of the %forward_list.
+       */
+      reference
+      front()
+      {
+        _Node* __front = static_cast<_Node*>(this->_M_impl._M_head._M_next);
+        return *__front->_M_valptr();
+      }
+
+      /**
+       *  Returns a read-only (constant) reference to the data at the first
+       *  element of the %forward_list.
+       */
+      const_reference
+      front() const
+      {
+        _Node* __front = static_cast<_Node*>(this->_M_impl._M_head._M_next);
+        return *__front->_M_valptr();
+      }
+
+      // 23.3.4.5 modifiers:
+
+      /**
+       *  @brief  Constructs object in %forward_list at the front of the
+       *          list.
+       *  @param  __args  Arguments.
+       *
+       *  This function will insert an object of type Tp constructed
+       *  with Tp(std::forward<Args>(args)...) at the front of the list
+       *  Due to the nature of a %forward_list this operation can
+       *  be done in constant time, and does not invalidate iterators
+       *  and references.
+       */
+      template<typename... _Args>
+#if __cplusplus > 201402L
+        reference
+#else
+	void
+#endif
+        emplace_front(_Args&&... __args)
+        {
+	  this->_M_insert_after(cbefore_begin(),
+                                std::forward<_Args>(__args)...);
+#if __cplusplus > 201402L
+	  return front();
+#endif
+	}
+
+      /**
+       *  @brief  Add data to the front of the %forward_list.
+       *  @param  __val  Data to be added.
+       *
+       *  This is a typical stack operation.  The function creates an
+       *  element at the front of the %forward_list and assigns the given
+       *  data to it.  Due to the nature of a %forward_list this operation
+       *  can be done in constant time, and does not invalidate iterators
+       *  and references.
+       */
+      void
+      push_front(const _Tp& __val)
+      { this->_M_insert_after(cbefore_begin(), __val); }
+
+      /**
+       *
+       */
+      void
+      push_front(_Tp&& __val)
+      { this->_M_insert_after(cbefore_begin(), std::move(__val)); }
+
+      /**
+       *  @brief  Removes first element.
+       *
+       *  This is a typical stack operation.  It shrinks the %forward_list
+       *  by one.  Due to the nature of a %forward_list this operation can
+       *  be done in constant time, and only invalidates iterators/references
+       *  to the element being removed.
+       *
+       *  Note that no data is returned, and if the first element's data
+       *  is needed, it should be retrieved before pop_front() is
+       *  called.
+       */
+      void
+      pop_front()
+      { this->_M_erase_after(&this->_M_impl._M_head); }
+
+      /**
+       *  @brief  Constructs object in %forward_list after the specified
+       *          iterator.
+       *  @param  __pos  A const_iterator into the %forward_list.
+       *  @param  __args  Arguments.
+       *  @return  An iterator that points to the inserted data.
+       *
+       *  This function will insert an object of type T constructed
+       *  with T(std::forward<Args>(args)...) after the specified
+       *  location.  Due to the nature of a %forward_list this operation can
+       *  be done in constant time, and does not invalidate iterators
+       *  and references.
+       */
+      template<typename... _Args>
+        iterator
+        emplace_after(const_iterator __pos, _Args&&... __args)
+        { return iterator(this->_M_insert_after(__pos,
+                                          std::forward<_Args>(__args)...)); }
+
+      /**
+       *  @brief  Inserts given value into %forward_list after specified
+       *          iterator.
+       *  @param  __pos  An iterator into the %forward_list.
+       *  @param  __val  Data to be inserted.
+       *  @return  An iterator that points to the inserted data.
+       *
+       *  This function will insert a copy of the given value after
+       *  the specified location.  Due to the nature of a %forward_list this
+       *  operation can be done in constant time, and does not
+       *  invalidate iterators and references.
+       */
+      iterator
+      insert_after(const_iterator __pos, const _Tp& __val)
+      { return iterator(this->_M_insert_after(__pos, __val)); }
+
+      /**
+       *
+       */
+      iterator
+      insert_after(const_iterator __pos, _Tp&& __val)
+      { return iterator(this->_M_insert_after(__pos, std::move(__val))); }
+
+      /**
+       *  @brief  Inserts a number of copies of given data into the
+       *          %forward_list.
+       *  @param  __pos  An iterator into the %forward_list.
+       *  @param  __n  Number of elements to be inserted.
+       *  @param  __val  Data to be inserted.
+       *  @return  An iterator pointing to the last inserted copy of
+       *           @a val or @a pos if @a n == 0.
+       *
+       *  This function will insert a specified number of copies of the
+       *  given data after the location specified by @a pos.
+       *
+       *  This operation is linear in the number of elements inserted and
+       *  does not invalidate iterators and references.
+       */
+      iterator
+      insert_after(const_iterator __pos, size_type __n, const _Tp& __val);
+
+      /**
+       *  @brief  Inserts a range into the %forward_list.
+       *  @param  __pos  An iterator into the %forward_list.
+       *  @param  __first  An input iterator.
+       *  @param  __last   An input iterator.
+       *  @return  An iterator pointing to the last inserted element or
+       *           @a __pos if @a __first == @a __last.
+       *
+       *  This function will insert copies of the data in the range
+       *  [@a __first,@a __last) into the %forward_list after the
+       *  location specified by @a __pos.
+       *
+       *  This operation is linear in the number of elements inserted and
+       *  does not invalidate iterators and references.
+       */
+      template<typename _InputIterator,
+	       typename = std::_RequireInputIter<_InputIterator>>
+        iterator
+        insert_after(const_iterator __pos,
+                     _InputIterator __first, _InputIterator __last);
+
+      /**
+       *  @brief  Inserts the contents of an initializer_list into
+       *          %forward_list after the specified iterator.
+       *  @param  __pos  An iterator into the %forward_list.
+       *  @param  __il  An initializer_list of value_type.
+       *  @return  An iterator pointing to the last inserted element
+       *           or @a __pos if @a __il is empty.
+       *
+       *  This function will insert copies of the data in the
+       *  initializer_list @a __il into the %forward_list before the location
+       *  specified by @a __pos.
+       *
+       *  This operation is linear in the number of elements inserted and
+       *  does not invalidate iterators and references.
+       */
+      iterator
+      insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
+      { return insert_after(__pos, __il.begin(), __il.end()); }
+
+      /**
+       *  @brief  Removes the element pointed to by the iterator following
+       *          @c pos.
+       *  @param  __pos  Iterator pointing before element to be erased.
+       *  @return  An iterator pointing to the element following the one
+       *           that was erased, or end() if no such element exists.
+       *
+       *  This function will erase the element at the given position and
+       *  thus shorten the %forward_list by one.
+       *
+       *  Due to the nature of a %forward_list this operation can be done
+       *  in constant time, and only invalidates iterators/references to
+       *  the element being removed.  The user is also cautioned that
+       *  this function only erases the element, and that if the element
+       *  is itself a pointer, the pointed-to memory is not touched in
+       *  any way.  Managing the pointer is the user's responsibility.
+       */
+      iterator
+      erase_after(const_iterator __pos)
+      { return iterator(this->_M_erase_after(const_cast<_Node_base*>
+					     (__pos._M_node))); }
+
+      /**
+       *  @brief  Remove a range of elements.
+       *  @param  __pos  Iterator pointing before the first element to be
+       *                 erased.
+       *  @param  __last  Iterator pointing to one past the last element to be
+       *                  erased.
+       *  @return  @ __last.
+       *
+       *  This function will erase the elements in the range
+       *  @a (__pos,__last) and shorten the %forward_list accordingly.
+       *
+       *  This operation is linear time in the size of the range and only
+       *  invalidates iterators/references to the element being removed.
+       *  The user is also cautioned that this function only erases the
+       *  elements, and that if the elements themselves are pointers, the
+       *  pointed-to memory is not touched in any way.  Managing the pointer
+       *  is the user's responsibility.
+       */
+      iterator
+      erase_after(const_iterator __pos, const_iterator __last)
+      { return iterator(this->_M_erase_after(const_cast<_Node_base*>
+					     (__pos._M_node),
+					     const_cast<_Node_base*>
+					     (__last._M_node))); }
+
+      /**
+       *  @brief  Swaps data with another %forward_list.
+       *  @param  __list  A %forward_list of the same element and allocator
+       *                  types.
+       *
+       *  This exchanges the elements between two lists in constant
+       *  time.  Note that the global std::swap() function is
+       *  specialized such that std::swap(l1,l2) will feed to this
+       *  function.
+       *
+       *  Whether the allocators are swapped depends on the allocator traits.
+       */
+      void
+      swap(forward_list& __list) noexcept
+      {
+        std::swap(this->_M_impl._M_head._M_next,
+		  __list._M_impl._M_head._M_next);
+	_Node_alloc_traits::_S_on_swap(this->_M_get_Node_allocator(),
+                                       __list._M_get_Node_allocator());
+      }
+
+      /**
+       *  @brief Resizes the %forward_list to the specified number of
+       *         elements.
+       *  @param __sz Number of elements the %forward_list should contain.
+       *
+       *  This function will %resize the %forward_list to the specified
+       *  number of elements.  If the number is smaller than the
+       *  %forward_list's current number of elements the %forward_list
+       *  is truncated, otherwise the %forward_list is extended and the
+       *  new elements are default constructed.
+       */
+      void
+      resize(size_type __sz);
+
+      /**
+       *  @brief Resizes the %forward_list to the specified number of
+       *         elements.
+       *  @param __sz Number of elements the %forward_list should contain.
+       *  @param __val Data with which new elements should be populated.
+       *
+       *  This function will %resize the %forward_list to the specified
+       *  number of elements.  If the number is smaller than the
+       *  %forward_list's current number of elements the %forward_list
+       *  is truncated, otherwise the %forward_list is extended and new
+       *  elements are populated with given data.
+       */
+      void
+      resize(size_type __sz, const value_type& __val);
+
+      /**
+       *  @brief  Erases all the elements.
+       *
+       *  Note that this function only erases
+       *  the elements, and that if the elements themselves are
+       *  pointers, the pointed-to memory is not touched in any way.
+       *  Managing the pointer is the user's responsibility.
+       */
+      void
+      clear() noexcept
+      { this->_M_erase_after(&this->_M_impl._M_head, 0); }
+
+      // 23.3.4.6 forward_list operations:
+
+      /**
+       *  @brief  Insert contents of another %forward_list.
+       *  @param  __pos  Iterator referencing the element to insert after.
+       *  @param  __list  Source list.
+       *
+       *  The elements of @a list are inserted in constant time after
+       *  the element referenced by @a pos.  @a list becomes an empty
+       *  list.
+       *
+       *  Requires this != @a x.
+       */
+      void
+      splice_after(const_iterator __pos, forward_list&& __list) noexcept
+      {
+	if (!__list.empty())
+	  _M_splice_after(__pos, __list.before_begin(), __list.end());
+      }
+
+      void
+      splice_after(const_iterator __pos, forward_list& __list) noexcept
+      { splice_after(__pos, std::move(__list)); }
+
+      /**
+       *  @brief  Insert element from another %forward_list.
+       *  @param  __pos  Iterator referencing the element to insert after.
+       *  @param  __list  Source list.
+       *  @param  __i   Iterator referencing the element before the element
+       *                to move.
+       *
+       *  Removes the element in list @a list referenced by @a i and
+       *  inserts it into the current list after @a pos.
+       */
+      void
+      splice_after(const_iterator __pos, forward_list&& __list,
+                   const_iterator __i) noexcept;
+
+      void
+      splice_after(const_iterator __pos, forward_list& __list,
+                   const_iterator __i) noexcept
+      { splice_after(__pos, std::move(__list), __i); }
+
+      /**
+       *  @brief  Insert range from another %forward_list.
+       *  @param  __pos  Iterator referencing the element to insert after.
+       *  @param  __list  Source list.
+       *  @param  __before  Iterator referencing before the start of range
+       *                    in list.
+       *  @param  __last  Iterator referencing the end of range in list.
+       *
+       *  Removes elements in the range (__before,__last) and inserts them
+       *  after @a __pos in constant time.
+       *
+       *  Undefined if @a __pos is in (__before,__last).
+       *  @{
+       */
+      void
+      splice_after(const_iterator __pos, forward_list&&,
+                   const_iterator __before, const_iterator __last) noexcept
+      { _M_splice_after(__pos, __before, __last); }
+
+      void
+      splice_after(const_iterator __pos, forward_list&,
+                   const_iterator __before, const_iterator __last) noexcept
+      { _M_splice_after(__pos, __before, __last); }
+      // @}
+
+      /**
+       *  @brief  Remove all elements equal to value.
+       *  @param  __val  The value to remove.
+       *
+       *  Removes every element in the list equal to @a __val.
+       *  Remaining elements stay in list order.  Note that this
+       *  function only erases the elements, and that if the elements
+       *  themselves are pointers, the pointed-to memory is not
+       *  touched in any way.  Managing the pointer is the user's
+       *  responsibility.
+       */
+      void
+      remove(const _Tp& __val);
+
+      /**
+       *  @brief  Remove all elements satisfying a predicate.
+       *  @param  __pred  Unary predicate function or object.
+       *
+       *  Removes every element in the list for which the predicate
+       *  returns true.  Remaining elements stay in list order.  Note
+       *  that this function only erases the elements, and that if the
+       *  elements themselves are pointers, the pointed-to memory is
+       *  not touched in any way.  Managing the pointer is the user's
+       *  responsibility.
+       */
+      template<typename _Pred>
+        void
+        remove_if(_Pred __pred);
+
+      /**
+       *  @brief  Remove consecutive duplicate elements.
+       *
+       *  For each consecutive set of elements with the same value,
+       *  remove all but the first one.  Remaining elements stay in
+       *  list order.  Note that this function only erases the
+       *  elements, and that if the elements themselves are pointers,
+       *  the pointed-to memory is not touched in any way.  Managing
+       *  the pointer is the user's responsibility.
+       */
+      void
+      unique()
+      { unique(std::equal_to<_Tp>()); }
+
+      /**
+       *  @brief  Remove consecutive elements satisfying a predicate.
+       *  @param  __binary_pred  Binary predicate function or object.
+       *
+       *  For each consecutive set of elements [first,last) that
+       *  satisfy predicate(first,i) where i is an iterator in
+       *  [first,last), remove all but the first one.  Remaining
+       *  elements stay in list order.  Note that this function only
+       *  erases the elements, and that if the elements themselves are
+       *  pointers, the pointed-to memory is not touched in any way.
+       *  Managing the pointer is the user's responsibility.
+       */
+      template<typename _BinPred>
+        void
+        unique(_BinPred __binary_pred);
+
+      /**
+       *  @brief  Merge sorted lists.
+       *  @param  __list  Sorted list to merge.
+       *
+       *  Assumes that both @a list and this list are sorted according to
+       *  operator<().  Merges elements of @a __list into this list in
+       *  sorted order, leaving @a __list empty when complete.  Elements in
+       *  this list precede elements in @a __list that are equal.
+       */
+      void
+      merge(forward_list&& __list)
+      { merge(std::move(__list), std::less<_Tp>()); }
+
+      void
+      merge(forward_list& __list)
+      { merge(std::move(__list)); }
+
+      /**
+       *  @brief  Merge sorted lists according to comparison function.
+       *  @param  __list  Sorted list to merge.
+       *  @param  __comp Comparison function defining sort order.
+       *
+       *  Assumes that both @a __list and this list are sorted according to
+       *  comp.  Merges elements of @a __list into this list
+       *  in sorted order, leaving @a __list empty when complete.  Elements
+       *  in this list precede elements in @a __list that are equivalent
+       *  according to comp().
+       */
+      template<typename _Comp>
+        void
+        merge(forward_list&& __list, _Comp __comp);
+
+      template<typename _Comp>
+        void
+        merge(forward_list& __list, _Comp __comp)
+        { merge(std::move(__list), __comp); }
+
+      /**
+       *  @brief  Sort the elements of the list.
+       *
+       *  Sorts the elements of this list in NlogN time.  Equivalent
+       *  elements remain in list order.
+       */
+      void
+      sort()
+      { sort(std::less<_Tp>()); }
+
+      /**
+       *  @brief  Sort the forward_list using a comparison function.
+       *
+       *  Sorts the elements of this list in NlogN time.  Equivalent
+       *  elements remain in list order.
+       */
+      template<typename _Comp>
+        void
+        sort(_Comp __comp);
+
+      /**
+       *  @brief  Reverse the elements in list.
+       *
+       *  Reverse the order of elements in the list in linear time.
+       */
+      void
+      reverse() noexcept
+      { this->_M_impl._M_head._M_reverse_after(); }
+
+    private:
+      // Called by the range constructor to implement [23.3.4.2]/9
+      template<typename _InputIterator>
+        void
+        _M_range_initialize(_InputIterator __first, _InputIterator __last);
+
+      // Called by forward_list(n,v,a), and the range constructor when it
+      // turns out to be the same thing.
+      void
+      _M_fill_initialize(size_type __n, const value_type& __value);
+
+      // Called by splice_after and insert_after.
+      iterator
+      _M_splice_after(const_iterator __pos, const_iterator __before,
+		      const_iterator __last);
+
+      // Called by forward_list(n).
+      void
+      _M_default_initialize(size_type __n);
+
+      // Called by resize(sz).
+      void
+      _M_default_insert_after(const_iterator __pos, size_type __n);
+
+      // Called by operator=(forward_list&&)
+      void
+      _M_move_assign(forward_list&& __list, std::true_type) noexcept
+      {
+        clear();
+        this->_M_impl._M_head._M_next = __list._M_impl._M_head._M_next;
+        __list._M_impl._M_head._M_next = nullptr;
+        std::__alloc_on_move(this->_M_get_Node_allocator(),
+                             __list._M_get_Node_allocator());
+      }
+
+      // Called by operator=(forward_list&&)
+      void
+      _M_move_assign(forward_list&& __list, std::false_type)
+      {
+        if (__list._M_get_Node_allocator() == this->_M_get_Node_allocator())
+          _M_move_assign(std::move(__list), std::true_type());
+        else
+	  // The rvalue's allocator cannot be moved, or is not equal,
+	  // so we need to individually move each element.
+	  this->assign(std::__make_move_if_noexcept_iterator(__list.begin()),
+		       std::__make_move_if_noexcept_iterator(__list.end()));
+      }
+
+      // Called by assign(_InputIterator, _InputIterator) if _Tp is
+      // CopyAssignable.
+      template<typename _InputIterator>
+	void
+        _M_assign(_InputIterator __first, _InputIterator __last, true_type)
+	{
+	  auto __prev = before_begin();
+	  auto __curr = begin();
+	  auto __end = end();
+	  while (__curr != __end && __first != __last)
+	    {
+	      *__curr = *__first;
+	      ++__prev;
+	      ++__curr;
+	      ++__first;
+	    }
+	  if (__first != __last)
+	    insert_after(__prev, __first, __last);
+	  else if (__curr != __end)
+	    erase_after(__prev, __end);
+        }
+
+      // Called by assign(_InputIterator, _InputIterator) if _Tp is not
+      // CopyAssignable.
+      template<typename _InputIterator>
+	void
+        _M_assign(_InputIterator __first, _InputIterator __last, false_type)
+	{
+	  clear();
+	  insert_after(cbefore_begin(), __first, __last);
+	}
+
+      // Called by assign(size_type, const _Tp&) if Tp is CopyAssignable
+      void
+      _M_assign_n(size_type __n, const _Tp& __val, true_type)
+      {
+	auto __prev = before_begin();
+	auto __curr = begin();
+	auto __end = end();
+	while (__curr != __end && __n > 0)
+	  {
+	    *__curr = __val;
+	    ++__prev;
+	    ++__curr;
+	    --__n;
+	  }
+	if (__n > 0)
+	  insert_after(__prev, __n, __val);
+	else if (__curr != __end)
+	  erase_after(__prev, __end);
+      }
+
+      // Called by assign(size_type, const _Tp&) if Tp is non-CopyAssignable
+      void
+      _M_assign_n(size_type __n, const _Tp& __val, false_type)
+      {
+	clear();
+	insert_after(cbefore_begin(), __n, __val);
+      }
+    };
+
+  /**
+   *  @brief  Forward list equality comparison.
+   *  @param  __lx  A %forward_list
+   *  @param  __ly  A %forward_list of the same type as @a __lx.
+   *  @return  True iff the elements of the forward lists are equal.
+   *
+   *  This is an equivalence relation.  It is linear in the number of 
+   *  elements of the forward lists.  Deques are considered equivalent
+   *  if corresponding elements compare equal.
+   */
+  template<typename _Tp, typename _Alloc>
+    bool
+    operator==(const forward_list<_Tp, _Alloc>& __lx,
+               const forward_list<_Tp, _Alloc>& __ly);
+
+  /**
+   *  @brief  Forward list ordering relation.
+   *  @param  __lx  A %forward_list.
+   *  @param  __ly  A %forward_list of the same type as @a __lx.
+   *  @return  True iff @a __lx is lexicographically less than @a __ly.
+   *
+   *  This is a total ordering relation.  It is linear in the number of 
+   *  elements of the forward lists.  The elements must be comparable
+   *  with @c <.
+   *
+   *  See std::lexicographical_compare() for how the determination is made.
+   */
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator<(const forward_list<_Tp, _Alloc>& __lx,
+              const forward_list<_Tp, _Alloc>& __ly)
+    { return std::lexicographical_compare(__lx.cbegin(), __lx.cend(),
+					  __ly.cbegin(), __ly.cend()); }
+
+  /// Based on operator==
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator!=(const forward_list<_Tp, _Alloc>& __lx,
+               const forward_list<_Tp, _Alloc>& __ly)
+    { return !(__lx == __ly); }
+
+  /// Based on operator<
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator>(const forward_list<_Tp, _Alloc>& __lx,
+              const forward_list<_Tp, _Alloc>& __ly)
+    { return (__ly < __lx); }
+
+  /// Based on operator<
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator>=(const forward_list<_Tp, _Alloc>& __lx,
+               const forward_list<_Tp, _Alloc>& __ly)
+    { return !(__lx < __ly); }
+
+  /// Based on operator<
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator<=(const forward_list<_Tp, _Alloc>& __lx,
+               const forward_list<_Tp, _Alloc>& __ly)
+    { return !(__ly < __lx); }
+
+  /// See std::forward_list::swap().
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(forward_list<_Tp, _Alloc>& __lx,
+	 forward_list<_Tp, _Alloc>& __ly)
+    noexcept(noexcept(__lx.swap(__ly)))
+    { __lx.swap(__ly); }
+
+_GLIBCXX_END_NAMESPACE_CONTAINER
+} // namespace std
+
+#endif // _FORWARD_LIST_H

+ 499 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/forward_list.tcc

@@ -0,0 +1,499 @@
+// <forward_list.tcc> -*- C++ -*-
+
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/forward_list.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{forward_list}
+ */
+
+#ifndef _FORWARD_LIST_TCC
+#define _FORWARD_LIST_TCC 1
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+
+  template<typename _Tp, typename _Alloc>
+    _Fwd_list_base<_Tp, _Alloc>::
+    _Fwd_list_base(_Fwd_list_base&& __lst, _Node_alloc_type&& __a)
+    : _M_impl(std::move(__a))
+    {
+      if (__lst._M_get_Node_allocator() == _M_get_Node_allocator())
+	{
+	  this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next;
+	  __lst._M_impl._M_head._M_next = 0;
+	}
+      else
+	this->_M_impl._M_head._M_next = 0;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+      _Fwd_list_node_base*
+      _Fwd_list_base<_Tp, _Alloc>::
+      _M_insert_after(const_iterator __pos, _Args&&... __args)
+      {
+        _Fwd_list_node_base* __to
+	  = const_cast<_Fwd_list_node_base*>(__pos._M_node);
+	_Node* __thing = _M_create_node(std::forward<_Args>(__args)...);
+        __thing->_M_next = __to->_M_next;
+        __to->_M_next = __thing;
+        return __to->_M_next;
+      }
+
+  template<typename _Tp, typename _Alloc>
+    _Fwd_list_node_base*
+    _Fwd_list_base<_Tp, _Alloc>::
+    _M_erase_after(_Fwd_list_node_base* __pos)
+    {
+      _Node* __curr = static_cast<_Node*>(__pos->_M_next);
+      __pos->_M_next = __curr->_M_next;
+      _Node_alloc_traits::destroy(_M_get_Node_allocator(),
+				  __curr->_M_valptr());
+      __curr->~_Node();
+      _M_put_node(__curr);
+      return __pos->_M_next;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    _Fwd_list_node_base*
+    _Fwd_list_base<_Tp, _Alloc>::
+    _M_erase_after(_Fwd_list_node_base* __pos, 
+                   _Fwd_list_node_base* __last)
+    {
+      _Node* __curr = static_cast<_Node*>(__pos->_M_next);
+      while (__curr != __last)
+        {
+          _Node* __temp = __curr;
+          __curr = static_cast<_Node*>(__curr->_M_next);
+	  _Node_alloc_traits::destroy(_M_get_Node_allocator(),
+				      __temp->_M_valptr());
+	  __temp->~_Node();
+          _M_put_node(__temp);
+        }
+      __pos->_M_next = __last;
+      return __last;
+    }
+
+  // Called by the range constructor to implement [23.3.4.2]/9
+  template<typename _Tp, typename _Alloc>
+    template<typename _InputIterator>
+      void
+      forward_list<_Tp, _Alloc>::
+      _M_range_initialize(_InputIterator __first, _InputIterator __last)
+      {
+        _Node_base* __to = &this->_M_impl._M_head;
+        for (; __first != __last; ++__first)
+          {
+            __to->_M_next = this->_M_create_node(*__first);
+            __to = __to->_M_next;
+          }
+      }
+
+  // Called by forward_list(n,v,a).
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    _M_fill_initialize(size_type __n, const value_type& __value)
+    {
+      _Node_base* __to = &this->_M_impl._M_head;
+      for (; __n; --__n)
+        {
+          __to->_M_next = this->_M_create_node(__value);
+          __to = __to->_M_next;
+        }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    _M_default_initialize(size_type __n)
+    {
+      _Node_base* __to = &this->_M_impl._M_head;
+      for (; __n; --__n)
+        {
+          __to->_M_next = this->_M_create_node();
+          __to = __to->_M_next;
+        }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    forward_list<_Tp, _Alloc>&
+    forward_list<_Tp, _Alloc>::
+    operator=(const forward_list& __list)
+    {
+      if (std::__addressof(__list) != this)
+        {
+	  if (_Node_alloc_traits::_S_propagate_on_copy_assign())
+	    {
+              auto& __this_alloc = this->_M_get_Node_allocator();
+              auto& __that_alloc = __list._M_get_Node_allocator();
+              if (!_Node_alloc_traits::_S_always_equal()
+	          && __this_alloc != __that_alloc)
+	        {
+		  // replacement allocator cannot free existing storage
+		  clear();
+		}
+	      std::__alloc_on_copy(__this_alloc, __that_alloc);
+            }
+	  assign(__list.cbegin(), __list.cend());
+        }
+      return *this;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    _M_default_insert_after(const_iterator __pos, size_type __n)
+    {
+      const_iterator __saved_pos = __pos;
+      __try
+	{
+	  for (; __n; --__n)
+	    __pos = emplace_after(__pos);
+	}
+      __catch(...)
+	{
+	  erase_after(__saved_pos, ++__pos);
+	  __throw_exception_again;
+	}
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    resize(size_type __sz)
+    {
+      iterator __k = before_begin();
+
+      size_type __len = 0;
+      while (__k._M_next() != end() && __len < __sz)
+        {
+          ++__k;
+          ++__len;
+        }
+      if (__len == __sz)
+        erase_after(__k, end());
+      else
+	_M_default_insert_after(__k, __sz - __len);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    resize(size_type __sz, const value_type& __val)
+    {
+      iterator __k = before_begin();
+
+      size_type __len = 0;
+      while (__k._M_next() != end() && __len < __sz)
+        {
+          ++__k;
+          ++__len;
+        }
+      if (__len == __sz)
+        erase_after(__k, end());
+      else
+        insert_after(__k, __sz - __len, __val);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    typename forward_list<_Tp, _Alloc>::iterator
+    forward_list<_Tp, _Alloc>::
+    _M_splice_after(const_iterator __pos,
+		    const_iterator __before, const_iterator __last)
+    {
+      _Node_base* __tmp = const_cast<_Node_base*>(__pos._M_node);
+      _Node_base* __b = const_cast<_Node_base*>(__before._M_node);
+      _Node_base* __end = __b;
+
+      while (__end && __end->_M_next != __last._M_node)
+	__end = __end->_M_next;
+
+      if (__b != __end)
+	return iterator(__tmp->_M_transfer_after(__b, __end));      
+      else
+	return iterator(__tmp);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    splice_after(const_iterator __pos, forward_list&&,
+		 const_iterator __i) noexcept
+    {
+      const_iterator __j = __i;
+      ++__j;
+
+      if (__pos == __i || __pos == __j)
+	return;
+
+      _Node_base* __tmp = const_cast<_Node_base*>(__pos._M_node);
+      __tmp->_M_transfer_after(const_cast<_Node_base*>(__i._M_node),
+			       const_cast<_Node_base*>(__j._M_node));
+    }
+
+  template<typename _Tp, typename _Alloc>
+    typename forward_list<_Tp, _Alloc>::iterator
+    forward_list<_Tp, _Alloc>::
+    insert_after(const_iterator __pos, size_type __n, const _Tp& __val)
+    {
+      if (__n)
+	{
+	  forward_list __tmp(__n, __val, get_allocator());
+	  return _M_splice_after(__pos, __tmp.before_begin(), __tmp.end());
+	}
+      else
+	return iterator(const_cast<_Node_base*>(__pos._M_node));
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _InputIterator, typename>
+      typename forward_list<_Tp, _Alloc>::iterator
+      forward_list<_Tp, _Alloc>::
+      insert_after(const_iterator __pos,
+		   _InputIterator __first, _InputIterator __last)
+      {
+	forward_list __tmp(__first, __last, get_allocator());
+	if (!__tmp.empty())
+	  return _M_splice_after(__pos, __tmp.before_begin(), __tmp.end());
+	else
+	  return iterator(const_cast<_Node_base*>(__pos._M_node));
+      }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    forward_list<_Tp, _Alloc>::
+    remove(const _Tp& __val)
+    {
+      _Node_base* __curr = &this->_M_impl._M_head;
+      _Node_base* __extra = nullptr;
+
+      while (_Node* __tmp = static_cast<_Node*>(__curr->_M_next))
+        {
+          if (*__tmp->_M_valptr() == __val)
+	    {
+	      if (__tmp->_M_valptr() != std::__addressof(__val))
+		{
+		  this->_M_erase_after(__curr);
+		  continue;
+		}
+	      else
+		__extra = __curr;
+	    }
+	  __curr = __curr->_M_next;
+        }
+
+      if (__extra)
+	this->_M_erase_after(__extra);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _Pred>
+      void
+      forward_list<_Tp, _Alloc>::
+      remove_if(_Pred __pred)
+      {
+	_Node_base* __curr = &this->_M_impl._M_head;
+        while (_Node* __tmp = static_cast<_Node*>(__curr->_M_next))
+          {
+            if (__pred(*__tmp->_M_valptr()))
+              this->_M_erase_after(__curr);
+            else
+              __curr = __curr->_M_next;
+          }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _BinPred>
+      void
+      forward_list<_Tp, _Alloc>::
+      unique(_BinPred __binary_pred)
+      {
+        iterator __first = begin();
+        iterator __last = end();
+        if (__first == __last)
+          return;
+        iterator __next = __first;
+        while (++__next != __last)
+        {
+          if (__binary_pred(*__first, *__next))
+            erase_after(__first);
+          else
+            __first = __next;
+          __next = __first;
+        }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _Comp>
+      void
+      forward_list<_Tp, _Alloc>::
+      merge(forward_list&& __list, _Comp __comp)
+      {
+        _Node_base* __node = &this->_M_impl._M_head;
+        while (__node->_M_next && __list._M_impl._M_head._M_next)
+          {
+            if (__comp(*static_cast<_Node*>
+                       (__list._M_impl._M_head._M_next)->_M_valptr(),
+                       *static_cast<_Node*>
+                       (__node->_M_next)->_M_valptr()))
+              __node->_M_transfer_after(&__list._M_impl._M_head,
+                                        __list._M_impl._M_head._M_next);
+            __node = __node->_M_next;
+          }
+        if (__list._M_impl._M_head._M_next)
+          {
+            __node->_M_next = __list._M_impl._M_head._M_next;
+            __list._M_impl._M_head._M_next = 0;
+          }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    bool
+    operator==(const forward_list<_Tp, _Alloc>& __lx,
+               const forward_list<_Tp, _Alloc>& __ly)
+    {
+      //  We don't have size() so we need to walk through both lists
+      //  making sure both iterators are valid.
+      auto __ix = __lx.cbegin();
+      auto __iy = __ly.cbegin();
+      while (__ix != __lx.cend() && __iy != __ly.cend())
+        {
+          if (!(*__ix == *__iy))
+            return false;
+          ++__ix;
+          ++__iy;
+        }
+      if (__ix == __lx.cend() && __iy == __ly.cend())
+        return true;
+      else
+        return false;
+    }
+
+  template<typename _Tp, class _Alloc>
+    template<typename _Comp>
+      void
+      forward_list<_Tp, _Alloc>::
+      sort(_Comp __comp)
+      {
+        // If `next' is 0, return immediately.
+        _Node* __list = static_cast<_Node*>(this->_M_impl._M_head._M_next);
+        if (!__list)
+          return;
+
+        unsigned long __insize = 1;
+
+        while (1)
+          {
+            _Node* __p = __list;
+            __list = 0;
+            _Node* __tail = 0;
+
+            // Count number of merges we do in this pass.
+            unsigned long __nmerges = 0;
+
+            while (__p)
+              {
+                ++__nmerges;
+                // There exists a merge to be done.
+                // Step `insize' places along from p.
+                _Node* __q = __p;
+                unsigned long __psize = 0;
+                for (unsigned long __i = 0; __i < __insize; ++__i)
+                  {
+                    ++__psize;
+                    __q = static_cast<_Node*>(__q->_M_next);
+                    if (!__q)
+                      break;
+                  }
+
+                // If q hasn't fallen off end, we have two lists to merge.
+                unsigned long __qsize = __insize;
+
+                // Now we have two lists; merge them.
+                while (__psize > 0 || (__qsize > 0 && __q))
+                  {
+                    // Decide whether next node of merge comes from p or q.
+                    _Node* __e;
+                    if (__psize == 0)
+                      {
+                        // p is empty; e must come from q.
+                        __e = __q;
+                        __q = static_cast<_Node*>(__q->_M_next);
+                        --__qsize;
+                      }
+                    else if (__qsize == 0 || !__q)
+                      {
+                        // q is empty; e must come from p.
+                        __e = __p;
+                        __p = static_cast<_Node*>(__p->_M_next);
+                        --__psize;
+                      }
+                    else if (!__comp(*__q->_M_valptr(), *__p->_M_valptr()))
+                      {
+                        // First node of q is not lower; e must come from p.
+                        __e = __p;
+                        __p = static_cast<_Node*>(__p->_M_next);
+                        --__psize;
+                      }
+                    else
+                      {
+                        // First node of q is lower; e must come from q.
+                        __e = __q;
+                        __q = static_cast<_Node*>(__q->_M_next);
+                        --__qsize;
+                      }
+
+                    // Add the next node to the merged list.
+                    if (__tail)
+                      __tail->_M_next = __e;
+                    else
+                      __list = __e;
+                    __tail = __e;
+                  }
+
+                // Now p has stepped `insize' places along, and q has too.
+                __p = __q;
+              }
+            __tail->_M_next = 0;
+
+            // If we have done only one merge, we're finished.
+            // Allow for nmerges == 0, the empty list case.
+            if (__nmerges <= 1)
+              {
+                this->_M_impl._M_head._M_next = __list;
+                return;
+              }
+
+            // Otherwise repeat, merging lists twice the size.
+            __insize *= 2;
+          }
+      }
+ 
+_GLIBCXX_END_NAMESPACE_CONTAINER
+} // namespace std
+
+#endif /* _FORWARD_LIST_TCC */
+

+ 1069 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/fstream.tcc

@@ -0,0 +1,1069 @@
+// File based streams -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/fstream.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{fstream}
+ */
+
+//
+// ISO C++ 14882: 27.8  File-based streams
+//
+
+#ifndef _FSTREAM_TCC
+#define _FSTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <bits/cxxabi_forced.h>
+#include <bits/move.h>   // for swap
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_filebuf<_CharT, _Traits>::
+    _M_allocate_internal_buffer()
+    {
+      // Allocate internal buffer only if one doesn't already exist
+      // (either allocated or provided by the user via setbuf).
+      if (!_M_buf_allocated && !_M_buf)
+	{
+	  _M_buf = new char_type[_M_buf_size];
+	  _M_buf_allocated = true;
+	}
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_filebuf<_CharT, _Traits>::
+    _M_destroy_internal_buffer() throw()
+    {
+      if (_M_buf_allocated)
+	{
+	  delete [] _M_buf;
+	  _M_buf = 0;
+	  _M_buf_allocated = false;
+	}
+      delete [] _M_ext_buf;
+      _M_ext_buf = 0;
+      _M_ext_buf_size = 0;
+      _M_ext_next = 0;
+      _M_ext_end = 0;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_filebuf<_CharT, _Traits>::
+    basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
+    _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(),
+    _M_state_last(), _M_buf(0), _M_buf_size(BUFSIZ),
+    _M_buf_allocated(false), _M_reading(false), _M_writing(false), _M_pback(), 
+    _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
+    _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0),
+    _M_ext_end(0)
+    {
+      if (has_facet<__codecvt_type>(this->_M_buf_locale))
+	_M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _CharT, typename _Traits>
+    basic_filebuf<_CharT, _Traits>::
+    basic_filebuf(basic_filebuf&& __rhs)
+    : __streambuf_type(__rhs),
+    _M_lock(), _M_file(std::move(__rhs._M_file), &_M_lock),
+    _M_mode(std::__exchange(__rhs._M_mode, ios_base::openmode(0))),
+    _M_state_beg(std::move(__rhs._M_state_beg)),
+    _M_state_cur(std::move(__rhs._M_state_cur)),
+    _M_state_last(std::move(__rhs._M_state_last)),
+    _M_buf(std::__exchange(__rhs._M_buf, nullptr)),
+    _M_buf_size(std::__exchange(__rhs._M_buf_size, 1)),
+    _M_buf_allocated(std::__exchange(__rhs._M_buf_allocated, false)),
+    _M_reading(std::__exchange(__rhs._M_reading, false)),
+    _M_writing(std::__exchange(__rhs._M_writing, false)),
+    _M_pback(__rhs._M_pback),
+    _M_pback_cur_save(std::__exchange(__rhs._M_pback_cur_save, nullptr)),
+    _M_pback_end_save(std::__exchange(__rhs._M_pback_end_save, nullptr)),
+    _M_pback_init(std::__exchange(__rhs._M_pback_init, false)),
+    _M_codecvt(__rhs._M_codecvt),
+    _M_ext_buf(std::__exchange(__rhs._M_ext_buf, nullptr)),
+    _M_ext_buf_size(std::__exchange(__rhs._M_ext_buf_size, 0)),
+    _M_ext_next(std::__exchange(__rhs._M_ext_next, nullptr)),
+    _M_ext_end(std::__exchange(__rhs._M_ext_end, nullptr))
+    {
+      __rhs._M_set_buffer(-1);
+      __rhs._M_state_last = __rhs._M_state_cur = __rhs._M_state_beg;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_filebuf<_CharT, _Traits>&
+    basic_filebuf<_CharT, _Traits>::
+    operator=(basic_filebuf&& __rhs)
+    {
+      this->close();
+      __streambuf_type::operator=(__rhs);
+      _M_file.swap(__rhs._M_file);
+      _M_mode = std::__exchange(__rhs._M_mode, ios_base::openmode(0));
+      _M_state_beg = std::move(__rhs._M_state_beg);
+      _M_state_cur = std::move(__rhs._M_state_cur);
+      _M_state_last = std::move(__rhs._M_state_last);
+      _M_buf = std::__exchange(__rhs._M_buf, nullptr);
+      _M_buf_size = std::__exchange(__rhs._M_buf_size, 1);
+      _M_buf_allocated = std::__exchange(__rhs._M_buf_allocated, false);
+      _M_ext_buf = std::__exchange(__rhs._M_ext_buf, nullptr);
+      _M_ext_buf_size = std::__exchange(__rhs._M_ext_buf_size, 0);
+      _M_ext_next = std::__exchange(__rhs._M_ext_next, nullptr);
+      _M_ext_end = std::__exchange(__rhs._M_ext_end, nullptr);
+      _M_reading = std::__exchange(__rhs._M_reading, false);
+      _M_writing = std::__exchange(__rhs._M_writing, false);
+      _M_pback_cur_save = std::__exchange(__rhs._M_pback_cur_save, nullptr);
+      _M_pback_end_save = std::__exchange(__rhs._M_pback_end_save, nullptr);
+      _M_pback_init = std::__exchange(__rhs._M_pback_init, false);
+      __rhs._M_set_buffer(-1);
+      __rhs._M_state_last = __rhs._M_state_cur = __rhs._M_state_beg;
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_filebuf<_CharT, _Traits>::
+    swap(basic_filebuf& __rhs)
+    {
+      __streambuf_type::swap(__rhs);
+      _M_file.swap(__rhs._M_file);
+      std::swap(_M_mode, __rhs._M_mode);
+      std::swap(_M_state_beg, __rhs._M_state_beg);
+      std::swap(_M_state_cur, __rhs._M_state_cur);
+      std::swap(_M_state_last, __rhs._M_state_last);
+      std::swap(_M_buf, __rhs._M_buf);
+      std::swap(_M_buf_size, __rhs._M_buf_size);
+      std::swap(_M_buf_allocated, __rhs._M_buf_allocated);
+      std::swap(_M_ext_buf, __rhs._M_ext_buf);
+      std::swap(_M_ext_buf_size, __rhs._M_ext_buf_size);
+      std::swap(_M_ext_next, __rhs._M_ext_next);
+      std::swap(_M_ext_end, __rhs._M_ext_end);
+      std::swap(_M_reading, __rhs._M_reading);
+      std::swap(_M_writing, __rhs._M_writing);
+      std::swap(_M_pback_cur_save, __rhs._M_pback_cur_save);
+      std::swap(_M_pback_end_save, __rhs._M_pback_end_save);
+      std::swap(_M_pback_init, __rhs._M_pback_init);
+    }
+#endif
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
+    basic_filebuf<_CharT, _Traits>::
+    open(const char* __s, ios_base::openmode __mode)
+    {
+      __filebuf_type *__ret = 0;
+      if (!this->is_open())
+	{
+	  _M_file.open(__s, __mode);
+	  if (this->is_open())
+	    {
+	      _M_allocate_internal_buffer();
+	      _M_mode = __mode;
+
+	      // Setup initial buffer to 'uncommitted' mode.
+	      _M_reading = false;
+	      _M_writing = false;
+	      _M_set_buffer(-1);
+
+	      // Reset to initial state.
+	      _M_state_last = _M_state_cur = _M_state_beg;
+
+	      // 27.8.1.3,4
+	      if ((__mode & ios_base::ate)
+		  && this->seekoff(0, ios_base::end, __mode)
+		  == pos_type(off_type(-1)))
+		this->close();
+	      else
+		__ret = this;
+	    }
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
+    basic_filebuf<_CharT, _Traits>::
+    close()
+    {
+      if (!this->is_open())
+	return 0;
+
+      bool __testfail = false;
+      {
+	// NB: Do this here so that re-opened filebufs will be cool...
+	struct __close_sentry
+	{
+	  basic_filebuf *__fb;
+	  __close_sentry (basic_filebuf *__fbi): __fb(__fbi) { }
+	  ~__close_sentry ()
+	  {
+	    __fb->_M_mode = ios_base::openmode(0);
+	    __fb->_M_pback_init = false;
+	    __fb->_M_destroy_internal_buffer();
+	    __fb->_M_reading = false;
+	    __fb->_M_writing = false;
+	    __fb->_M_set_buffer(-1);
+	    __fb->_M_state_last = __fb->_M_state_cur = __fb->_M_state_beg;
+	  }
+	} __cs (this);
+
+	__try
+	  {
+	    if (!_M_terminate_output())
+	      __testfail = true;
+	  }
+	__catch(__cxxabiv1::__forced_unwind&)
+	  {
+	    _M_file.close();
+	    __throw_exception_again;
+	  }
+	__catch(...)
+	  { __testfail = true; }
+      }
+
+      if (!_M_file.close())
+	__testfail = true;
+
+      if (__testfail)
+	return 0;
+      else
+	return this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_filebuf<_CharT, _Traits>::
+    showmanyc()
+    {
+      streamsize __ret = -1;
+      const bool __testin = _M_mode & ios_base::in;
+      if (__testin && this->is_open())
+	{
+	  // For a stateful encoding (-1) the pending sequence might be just
+	  // shift and unshift prefixes with no actual character.
+	  __ret = this->egptr() - this->gptr();
+
+#if _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM
+	  // About this workaround, see libstdc++/20806.
+	  const bool __testbinary = _M_mode & ios_base::binary;
+	  if (__check_facet(_M_codecvt).encoding() >= 0
+	      && __testbinary)
+#else
+	  if (__check_facet(_M_codecvt).encoding() >= 0)
+#endif
+	    __ret += _M_file.showmanyc() / _M_codecvt->max_length();
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::int_type
+    basic_filebuf<_CharT, _Traits>::
+    underflow()
+    {
+      int_type __ret = traits_type::eof();
+      const bool __testin = _M_mode & ios_base::in;
+      if (__testin)
+	{
+	  if (_M_writing)
+	    {
+	      if (overflow() == traits_type::eof())
+		return __ret;
+	      _M_set_buffer(-1);
+	      _M_writing = false;
+	    }
+	  // Check for pback madness, and if so switch back to the
+	  // normal buffers and jet outta here before expensive
+	  // fileops happen...
+	  _M_destroy_pback();
+
+	  if (this->gptr() < this->egptr())
+	    return traits_type::to_int_type(*this->gptr());
+
+	  // Get and convert input sequence.
+	  const size_t __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
+
+	  // Will be set to true if ::read() returns 0 indicating EOF.
+	  bool __got_eof = false;
+	  // Number of internal characters produced.
+	  streamsize __ilen = 0;
+	  codecvt_base::result __r = codecvt_base::ok;
+	  if (__check_facet(_M_codecvt).always_noconv())
+	    {
+	      __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
+				      __buflen);
+	      if (__ilen == 0)
+		__got_eof = true;
+	    }
+	  else
+	    {
+              // Worst-case number of external bytes.
+	      // XXX Not done encoding() == -1.
+	      const int __enc = _M_codecvt->encoding();
+	      streamsize __blen; // Minimum buffer size.
+	      streamsize __rlen; // Number of chars to read.
+	      if (__enc > 0)
+		__blen = __rlen = __buflen * __enc;
+	      else
+		{
+		  __blen = __buflen + _M_codecvt->max_length() - 1;
+		  __rlen = __buflen;
+		}
+	      const streamsize __remainder = _M_ext_end - _M_ext_next;
+	      __rlen = __rlen > __remainder ? __rlen - __remainder : 0;
+
+	      // An imbue in 'read' mode implies first converting the external
+	      // chars already present.
+	      if (_M_reading && this->egptr() == this->eback() && __remainder)
+		__rlen = 0;
+
+	      // Allocate buffer if necessary and move unconverted
+	      // bytes to front.
+	      if (_M_ext_buf_size < __blen)
+		{
+		  char* __buf = new char[__blen];
+		  if (__remainder)
+		    __builtin_memcpy(__buf, _M_ext_next, __remainder);
+
+		  delete [] _M_ext_buf;
+		  _M_ext_buf = __buf;
+		  _M_ext_buf_size = __blen;
+		}
+	      else if (__remainder)
+		__builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+	      _M_ext_next = _M_ext_buf;
+	      _M_ext_end = _M_ext_buf + __remainder;
+	      _M_state_last = _M_state_cur;
+
+	      do
+		{
+		  if (__rlen > 0)
+		    {
+		      // Sanity check!
+		      // This may fail if the return value of
+		      // codecvt::max_length() is bogus.
+		      if (_M_ext_end - _M_ext_buf + __rlen > _M_ext_buf_size)
+			{
+			  __throw_ios_failure(__N("basic_filebuf::underflow "
+					      "codecvt::max_length() "
+					      "is not valid"));
+			}
+		      streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen);
+		      if (__elen == 0)
+			__got_eof = true;
+		      else if (__elen == -1)
+			break;
+		      _M_ext_end += __elen;
+		    }
+
+		  char_type* __iend = this->eback();
+		  if (_M_ext_next < _M_ext_end)
+		    __r = _M_codecvt->in(_M_state_cur, _M_ext_next,
+					 _M_ext_end, _M_ext_next,
+					 this->eback(),
+					 this->eback() + __buflen, __iend);
+		  if (__r == codecvt_base::noconv)
+		    {
+		      size_t __avail = _M_ext_end - _M_ext_buf;
+		      __ilen = std::min(__avail, __buflen);
+		      traits_type::copy(this->eback(),
+					reinterpret_cast<char_type*>
+					(_M_ext_buf), __ilen);
+		      _M_ext_next = _M_ext_buf + __ilen;
+		    }
+		  else
+		    __ilen = __iend - this->eback();
+
+		  // _M_codecvt->in may return error while __ilen > 0: this is
+		  // ok, and actually occurs in case of mixed encodings (e.g.,
+		  // XML files).
+		  if (__r == codecvt_base::error)
+		    break;
+
+		  __rlen = 1;
+		}
+	      while (__ilen == 0 && !__got_eof);
+	    }
+
+	  if (__ilen > 0)
+	    {
+	      _M_set_buffer(__ilen);
+	      _M_reading = true;
+	      __ret = traits_type::to_int_type(*this->gptr());
+	    }
+	  else if (__got_eof)
+	    {
+	      // If the actual end of file is reached, set 'uncommitted'
+	      // mode, thus allowing an immediate write without an
+	      // intervening seek.
+	      _M_set_buffer(-1);
+	      _M_reading = false;
+	      // However, reaching it while looping on partial means that
+	      // the file has got an incomplete character.
+	      if (__r == codecvt_base::partial)
+		__throw_ios_failure(__N("basic_filebuf::underflow "
+				    "incomplete character in file"));
+	    }
+	  else if (__r == codecvt_base::error)
+	    __throw_ios_failure(__N("basic_filebuf::underflow "
+				"invalid byte sequence in file"));
+	  else
+	    __throw_ios_failure(__N("basic_filebuf::underflow "
+				"error reading the file"));
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::int_type
+    basic_filebuf<_CharT, _Traits>::
+    pbackfail(int_type __i)
+    {
+      int_type __ret = traits_type::eof();
+      const bool __testin = _M_mode & ios_base::in;
+      if (__testin)
+	{
+	  if (_M_writing)
+	    {
+	      if (overflow() == traits_type::eof())
+		return __ret;
+	      _M_set_buffer(-1);
+	      _M_writing = false;
+	    }
+	  // Remember whether the pback buffer is active, otherwise below
+	  // we may try to store in it a second char (libstdc++/9761).
+	  const bool __testpb = _M_pback_init;
+	  const bool __testeof = traits_type::eq_int_type(__i, __ret);
+	  int_type __tmp;
+	  if (this->eback() < this->gptr())
+	    {
+	      this->gbump(-1);
+	      __tmp = traits_type::to_int_type(*this->gptr());
+	    }
+	  else if (this->seekoff(-1, ios_base::cur) != pos_type(off_type(-1)))
+	    {
+	      __tmp = this->underflow();
+	      if (traits_type::eq_int_type(__tmp, __ret))
+		return __ret;
+	    }
+	  else
+	    {
+	      // At the beginning of the buffer, need to make a
+	      // putback position available.  But the seek may fail
+	      // (f.i., at the beginning of a file, see
+	      // libstdc++/9439) and in that case we return
+	      // traits_type::eof().
+	      return __ret;
+	    }
+
+	  // Try to put back __i into input sequence in one of three ways.
+	  // Order these tests done in is unspecified by the standard.
+	  if (!__testeof && traits_type::eq_int_type(__i, __tmp))
+	    __ret = __i;
+	  else if (__testeof)
+	    __ret = traits_type::not_eof(__i);
+	  else if (!__testpb)
+	    {
+	      _M_create_pback();
+	      _M_reading = true;
+	      *this->gptr() = traits_type::to_char_type(__i);
+	      __ret = __i;
+	    }
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::int_type
+    basic_filebuf<_CharT, _Traits>::
+    overflow(int_type __c)
+    {
+      int_type __ret = traits_type::eof();
+      const bool __testeof = traits_type::eq_int_type(__c, __ret);
+      const bool __testout = (_M_mode & ios_base::out
+			      || _M_mode & ios_base::app);
+      if (__testout)
+	{
+          if (_M_reading)
+            {
+              _M_destroy_pback();
+              const int __gptr_off = _M_get_ext_pos(_M_state_last);
+              if (_M_seek(__gptr_off, ios_base::cur, _M_state_last)
+                  == pos_type(off_type(-1)))
+                return __ret;
+            }
+	  if (this->pbase() < this->pptr())
+	    {
+	      // If appropriate, append the overflow char.
+	      if (!__testeof)
+		{
+		  *this->pptr() = traits_type::to_char_type(__c);
+		  this->pbump(1);
+		}
+
+	      // Convert pending sequence to external representation,
+	      // and output.
+	      if (_M_convert_to_external(this->pbase(),
+					 this->pptr() - this->pbase()))
+		{
+		  _M_set_buffer(0);
+		  __ret = traits_type::not_eof(__c);
+		}
+	    }
+	  else if (_M_buf_size > 1)
+	    {
+	      // Overflow in 'uncommitted' mode: set _M_writing, set
+	      // the buffer to the initial 'write' mode, and put __c
+	      // into the buffer.
+	      _M_set_buffer(0);
+	      _M_writing = true;
+	      if (!__testeof)
+		{
+		  *this->pptr() = traits_type::to_char_type(__c);
+		  this->pbump(1);
+		}
+	      __ret = traits_type::not_eof(__c);
+	    }
+	  else
+	    {
+	      // Unbuffered.
+	      char_type __conv = traits_type::to_char_type(__c);
+	      if (__testeof || _M_convert_to_external(&__conv, 1))
+		{
+		  _M_writing = true;
+		  __ret = traits_type::not_eof(__c);
+		}
+	    }
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    bool
+    basic_filebuf<_CharT, _Traits>::
+    _M_convert_to_external(_CharT* __ibuf, streamsize __ilen)
+    {
+      // Sizes of external and pending output.
+      streamsize __elen;
+      streamsize __plen;
+      if (__check_facet(_M_codecvt).always_noconv())
+	{
+	  __elen = _M_file.xsputn(reinterpret_cast<char*>(__ibuf), __ilen);
+	  __plen = __ilen;
+	}
+      else
+	{
+	  // Worst-case number of external bytes needed.
+	  // XXX Not done encoding() == -1.
+	  streamsize __blen = __ilen * _M_codecvt->max_length();
+	  char* __buf = static_cast<char*>(__builtin_alloca(__blen));
+
+	  char* __bend;
+	  const char_type* __iend;
+	  codecvt_base::result __r;
+	  __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen,
+				__iend, __buf, __buf + __blen, __bend);
+
+	  if (__r == codecvt_base::ok || __r == codecvt_base::partial)
+	    __blen = __bend - __buf;
+	  else if (__r == codecvt_base::noconv)
+	    {
+	      // Same as the always_noconv case above.
+	      __buf = reinterpret_cast<char*>(__ibuf);
+	      __blen = __ilen;
+	    }
+	  else
+	    __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external "
+				    "conversion error"));
+  
+	  __elen = _M_file.xsputn(__buf, __blen);
+	  __plen = __blen;
+
+	  // Try once more for partial conversions.
+	  if (__r == codecvt_base::partial && __elen == __plen)
+	    {
+	      const char_type* __iresume = __iend;
+	      streamsize __rlen = this->pptr() - __iend;
+	      __r = _M_codecvt->out(_M_state_cur, __iresume,
+				    __iresume + __rlen, __iend, __buf,
+				    __buf + __blen, __bend);
+	      if (__r != codecvt_base::error)
+		{
+		  __rlen = __bend - __buf;
+		  __elen = _M_file.xsputn(__buf, __rlen);
+		  __plen = __rlen;
+		}
+	      else
+		__throw_ios_failure(__N("basic_filebuf::_M_convert_to_external "
+					"conversion error"));
+	    }
+	}
+      return __elen == __plen;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_filebuf<_CharT, _Traits>::
+    xsgetn(_CharT* __s, streamsize __n)
+    {
+      // Clear out pback buffer before going on to the real deal...
+      streamsize __ret = 0;
+      if (_M_pback_init)
+	{
+	  if (__n > 0 && this->gptr() == this->eback())
+	    {
+	      *__s++ = *this->gptr(); // emulate non-underflowing sbumpc
+	      this->gbump(1);
+	      __ret = 1;
+	      --__n;
+	    }
+	  _M_destroy_pback();
+	}
+      else if (_M_writing)
+	{
+ 	  if (overflow() == traits_type::eof())
+ 	    return __ret;
+ 	  _M_set_buffer(-1);
+ 	  _M_writing = false;
+ 	}
+ 
+      // Optimization in the always_noconv() case, to be generalized in the
+      // future: when __n > __buflen we read directly instead of using the
+      // buffer repeatedly.
+      const bool __testin = _M_mode & ios_base::in;
+      const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
+ 
+      if (__n > __buflen && __check_facet(_M_codecvt).always_noconv()
+ 	   && __testin)
+ 	 {
+ 	   // First, copy the chars already present in the buffer.
+ 	   const streamsize __avail = this->egptr() - this->gptr();
+ 	   if (__avail != 0)
+ 	     {
+	       traits_type::copy(__s, this->gptr(), __avail);
+ 	       __s += __avail;
+	       this->setg(this->eback(), this->gptr() + __avail,
+			  this->egptr());
+	       __ret += __avail;
+	       __n -= __avail;
+ 	     }
+ 
+ 	   // Need to loop in case of short reads (relatively common
+ 	   // with pipes).
+ 	   streamsize __len;
+ 	   for (;;)
+ 	     {
+ 	       __len = _M_file.xsgetn(reinterpret_cast<char*>(__s),
+ 				      __n);
+ 	       if (__len == -1)
+ 		 __throw_ios_failure(__N("basic_filebuf::xsgetn "
+ 					 "error reading the file"));
+ 	       if (__len == 0)
+ 		 break;
+ 
+ 	       __n -= __len;
+ 	       __ret += __len;
+ 	       if (__n == 0)
+ 		 break;
+ 
+ 	       __s += __len;
+ 	     }
+ 
+ 	   if (__n == 0)
+ 	     {
+	       // Set _M_reading. Buffer is already in initial 'read' mode.
+ 	       _M_reading = true;
+ 	     }
+ 	   else if (__len == 0)
+ 	     {
+ 	       // If end of file is reached, set 'uncommitted'
+ 	       // mode, thus allowing an immediate write without
+ 	       // an intervening seek.
+ 	       _M_set_buffer(-1);
+ 	       _M_reading = false;
+ 	     }
+ 	 }
+      else
+ 	 __ret += __streambuf_type::xsgetn(__s, __n);
+ 
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_filebuf<_CharT, _Traits>::
+    xsputn(const _CharT* __s, streamsize __n)
+    {
+      streamsize __ret = 0;
+      // Optimization in the always_noconv() case, to be generalized in the
+      // future: when __n is sufficiently large we write directly instead of
+      // using the buffer.
+      const bool __testout = (_M_mode & ios_base::out
+			      || _M_mode & ios_base::app);
+      if (__check_facet(_M_codecvt).always_noconv()
+ 	   && __testout && !_M_reading)
+	{
+	  // Measurement would reveal the best choice.
+	  const streamsize __chunk = 1ul << 10;
+	  streamsize __bufavail = this->epptr() - this->pptr();
+
+	  // Don't mistake 'uncommitted' mode buffered with unbuffered.
+	  if (!_M_writing && _M_buf_size > 1)
+	    __bufavail = _M_buf_size - 1;
+
+	  const streamsize __limit = std::min(__chunk, __bufavail);
+	  if (__n >= __limit)
+	    {
+	      const streamsize __buffill = this->pptr() - this->pbase();
+	      const char* __buf = reinterpret_cast<const char*>(this->pbase());
+	      __ret = _M_file.xsputn_2(__buf, __buffill,
+				       reinterpret_cast<const char*>(__s),
+				       __n);
+	      if (__ret == __buffill + __n)
+		{
+		  _M_set_buffer(0);
+		  _M_writing = true;
+		}
+	      if (__ret > __buffill)
+		__ret -= __buffill;
+	      else
+		__ret = 0;
+	    }
+	  else
+	    __ret = __streambuf_type::xsputn(__s, __n);
+	}
+       else
+	 __ret = __streambuf_type::xsputn(__s, __n);
+       return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
+    basic_filebuf<_CharT, _Traits>::
+    setbuf(char_type* __s, streamsize __n)
+    {
+      if (!this->is_open())
+	{
+	  if (__s == 0 && __n == 0)
+	    _M_buf_size = 1;
+	  else if (__s && __n > 0)
+	    {
+	      // This is implementation-defined behavior, and assumes that
+	      // an external char_type array of length __n exists and has
+	      // been pre-allocated. If this is not the case, things will
+	      // quickly blow up. When __n > 1, __n - 1 positions will be
+	      // used for the get area, __n - 1 for the put area and 1
+	      // position to host the overflow char of a full put area.
+	      // When __n == 1, 1 position will be used for the get area
+	      // and 0 for the put area, as in the unbuffered case above.
+	      _M_buf = __s;
+	      _M_buf_size = __n;
+	    }
+	}
+      return this;
+    }
+
+
+  // According to 27.8.1.4 p11 - 13, seekoff should ignore the last
+  // argument (of type openmode).
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::pos_type
+    basic_filebuf<_CharT, _Traits>::
+    seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode)
+    {
+      int __width = 0;
+      if (_M_codecvt)
+	__width = _M_codecvt->encoding();
+      if (__width < 0)
+	__width = 0;
+
+      pos_type __ret = pos_type(off_type(-1));
+      const bool __testfail = __off != 0 && __width <= 0;
+      if (this->is_open() && !__testfail)
+	{
+	  // tellg and tellp queries do not affect any state, unless
+	  // ! always_noconv and the put sequence is not empty.
+	  // In that case, determining the position requires converting the
+	  // put sequence. That doesn't use ext_buf, so requires a flush.
+	  bool __no_movement = __way == ios_base::cur && __off == 0
+	    && (!_M_writing || _M_codecvt->always_noconv());
+
+	  // Ditch any pback buffers to avoid confusion.
+	  if (!__no_movement)
+	    _M_destroy_pback();
+
+	  // Correct state at destination. Note that this is the correct
+	  // state for the current position during output, because
+	  // codecvt::unshift() returns the state to the initial state.
+	  // This is also the correct state at the end of the file because
+	  // an unshift sequence should have been written at the end.
+	  __state_type __state = _M_state_beg;
+	  off_type __computed_off = __off * __width;
+	  if (_M_reading && __way == ios_base::cur)
+	    {
+	      __state = _M_state_last;
+	      __computed_off += _M_get_ext_pos(__state);
+	    }
+	  if (!__no_movement)
+	    __ret = _M_seek(__computed_off, __way, __state);
+	  else
+	    {
+	      if (_M_writing)
+		__computed_off = this->pptr() - this->pbase();
+	      
+ 	      off_type __file_off = _M_file.seekoff(0, ios_base::cur);
+ 	      if (__file_off != off_type(-1))
+		{
+		  __ret = __file_off + __computed_off;
+		  __ret.state(__state);
+		}
+	    }
+	}
+      return __ret;
+    }
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 171. Strange seekpos() semantics due to joint position
+  // According to the resolution of DR 171, seekpos should ignore the last
+  // argument (of type openmode).
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::pos_type
+    basic_filebuf<_CharT, _Traits>::
+    seekpos(pos_type __pos, ios_base::openmode)
+    {
+      pos_type __ret =  pos_type(off_type(-1));
+      if (this->is_open())
+	{
+	  // Ditch any pback buffers to avoid confusion.
+	  _M_destroy_pback();
+	  __ret = _M_seek(off_type(__pos), ios_base::beg, __pos.state());
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_filebuf<_CharT, _Traits>::pos_type
+    basic_filebuf<_CharT, _Traits>::
+    _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state)
+    {
+      pos_type __ret = pos_type(off_type(-1));
+      if (_M_terminate_output())
+	{
+	  off_type __file_off = _M_file.seekoff(__off, __way);
+	  if (__file_off != off_type(-1))
+	    {
+	      _M_reading = false;
+	      _M_writing = false;
+	      _M_ext_next = _M_ext_end = _M_ext_buf;
+	      _M_set_buffer(-1);
+	      _M_state_cur = __state;
+	      __ret = __file_off;
+	      __ret.state(_M_state_cur);
+	    }
+	}
+      return __ret;
+    }
+
+  // Returns the distance from the end of the ext buffer to the point
+  // corresponding to gptr(). This is a negative value. Updates __state
+  // from eback() correspondence to gptr().
+  template<typename _CharT, typename _Traits>
+    int basic_filebuf<_CharT, _Traits>::
+    _M_get_ext_pos(__state_type& __state)
+    {
+      if (_M_codecvt->always_noconv())
+        return this->gptr() - this->egptr();
+      else
+        {
+          // Calculate offset from _M_ext_buf that corresponds to
+          // gptr(). Precondition: __state == _M_state_last, which
+          // corresponds to eback().
+          const int __gptr_off =
+            _M_codecvt->length(__state, _M_ext_buf, _M_ext_next,
+                               this->gptr() - this->eback());
+          return _M_ext_buf + __gptr_off - _M_ext_end;
+        }
+    }
+    
+  template<typename _CharT, typename _Traits>
+    bool
+    basic_filebuf<_CharT, _Traits>::
+    _M_terminate_output()
+    {
+      // Part one: update the output sequence.
+      bool __testvalid = true;
+      if (this->pbase() < this->pptr())
+	{
+	  const int_type __tmp = this->overflow();
+	  if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+	    __testvalid = false;
+	}
+
+      // Part two: output unshift sequence.
+      if (_M_writing && !__check_facet(_M_codecvt).always_noconv()
+	  && __testvalid)
+	{
+	  // Note: this value is arbitrary, since there is no way to
+	  // get the length of the unshift sequence from codecvt,
+	  // without calling unshift.
+	  const size_t __blen = 128;
+	  char __buf[__blen];
+	  codecvt_base::result __r;
+	  streamsize __ilen = 0;
+
+	  do
+	    {
+	      char* __next;
+	      __r = _M_codecvt->unshift(_M_state_cur, __buf,
+					__buf + __blen, __next);
+	      if (__r == codecvt_base::error)
+		__testvalid = false;
+	      else if (__r == codecvt_base::ok ||
+		       __r == codecvt_base::partial)
+		{
+		  __ilen = __next - __buf;
+		  if (__ilen > 0)
+		    {
+		      const streamsize __elen = _M_file.xsputn(__buf, __ilen);
+		      if (__elen != __ilen)
+			__testvalid = false;
+		    }
+		}
+	    }
+	  while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
+
+	  if (__testvalid)
+	    {
+	      // This second call to overflow() is required by the standard,
+	      // but it's not clear why it's needed, since the output buffer
+	      // should be empty by this point (it should have been emptied
+	      // in the first call to overflow()).
+	      const int_type __tmp = this->overflow();
+	      if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+		__testvalid = false;
+	    }
+	}
+      return __testvalid;
+    }
+
+  template<typename _CharT, typename _Traits>
+    int
+    basic_filebuf<_CharT, _Traits>::
+    sync()
+    {
+      // Make sure that the internal buffer resyncs its idea of
+      // the file position with the external file.
+      int __ret = 0;
+      if (this->pbase() < this->pptr())
+	{
+	  const int_type __tmp = this->overflow();
+	  if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+	    __ret = -1;
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_filebuf<_CharT, _Traits>::
+    imbue(const locale& __loc)
+    {
+      bool __testvalid = true;
+
+      const __codecvt_type* _M_codecvt_tmp = 0;
+      if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
+	_M_codecvt_tmp = &use_facet<__codecvt_type>(__loc);
+
+      if (this->is_open())
+	{
+	  // encoding() == -1 is ok only at the beginning.
+	  if ((_M_reading || _M_writing)
+	      && __check_facet(_M_codecvt).encoding() == -1)
+	    __testvalid = false;
+	  else
+	    {
+	      if (_M_reading)
+		{
+		  if (__check_facet(_M_codecvt).always_noconv())
+		    {
+		      if (_M_codecvt_tmp
+			  && !__check_facet(_M_codecvt_tmp).always_noconv())
+			__testvalid = this->seekoff(0, ios_base::cur, _M_mode)
+			              != pos_type(off_type(-1));
+		    }
+		  else
+		    {
+		      // External position corresponding to gptr().
+		      _M_ext_next = _M_ext_buf
+			+ _M_codecvt->length(_M_state_last, _M_ext_buf,
+					     _M_ext_next,
+					     this->gptr() - this->eback());
+		      const streamsize __remainder = _M_ext_end - _M_ext_next;
+		      if (__remainder)
+			__builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+		      _M_ext_next = _M_ext_buf;
+		      _M_ext_end = _M_ext_buf + __remainder;
+		      _M_set_buffer(-1);
+		      _M_state_last = _M_state_cur = _M_state_beg;
+		    }
+		}
+	      else if (_M_writing && (__testvalid = _M_terminate_output()))
+		_M_set_buffer(-1);
+	    }
+	}
+
+      if (__testvalid)
+	_M_codecvt = _M_codecvt_tmp;
+      else
+	_M_codecvt = 0;
+    }
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class basic_filebuf<char>;
+  extern template class basic_ifstream<char>;
+  extern template class basic_ofstream<char>;
+  extern template class basic_fstream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class basic_filebuf<wchar_t>;
+  extern template class basic_ifstream<wchar_t>;
+  extern template class basic_ofstream<wchar_t>;
+  extern template class basic_fstream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 110 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/functexcept.h

@@ -0,0 +1,110 @@
+// Function-Based Exception Support -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/functexcept.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{exception}
+ *
+ *  This header provides support for -fno-exceptions.
+ */
+
+//
+// ISO C++ 14882: 19.1  Exception classes
+//
+
+#ifndef _FUNCTEXCEPT_H
+#define _FUNCTEXCEPT_H 1
+
+#include <bits/c++config.h>
+#include <bits/exception_defines.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Helper for exception objects in <except>
+  void
+  __throw_bad_exception(void) __attribute__((__noreturn__));
+
+  // Helper for exception objects in <new>
+  void
+  __throw_bad_alloc(void) __attribute__((__noreturn__));
+
+  // Helper for exception objects in <typeinfo>
+  void
+  __throw_bad_cast(void) __attribute__((__noreturn__));
+
+  void
+  __throw_bad_typeid(void) __attribute__((__noreturn__));
+
+  // Helpers for exception objects in <stdexcept>
+  void
+  __throw_logic_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_domain_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_invalid_argument(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_length_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_out_of_range(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__gnu_printf__, 1, 2)));
+
+  void
+  __throw_runtime_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_range_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_overflow_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_underflow_error(const char*) __attribute__((__noreturn__));
+
+  // Helpers for exception objects in <ios>
+  void
+  __throw_ios_failure(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_system_error(int) __attribute__((__noreturn__));
+
+  void
+  __throw_future_error(int) __attribute__((__noreturn__));
+
+  // Helpers for exception objects in <functional>
+  void
+  __throw_bad_function_call() __attribute__((__noreturn__));
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 274 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/functional_hash.h

@@ -0,0 +1,274 @@
+// functional_hash.h header -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/functional_hash.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{functional}
+ */
+
+#ifndef _FUNCTIONAL_HASH_H
+#define _FUNCTIONAL_HASH_H 1
+
+#pragma GCC system_header
+
+#include <bits/hash_bytes.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /** @defgroup hashes Hashes
+   *  @ingroup functors
+   *
+   *   Hashing functors taking a variable type and returning a @c std::size_t.
+   *
+   *  @{
+   */
+
+  template<typename _Result, typename _Arg>
+    struct __hash_base
+    {
+      typedef _Result     result_type;
+      typedef _Arg      argument_type;
+    };
+
+  /// Primary class template hash.
+  template<typename _Tp>
+    struct hash;
+
+  template<typename _Tp, typename = void>
+    struct __poison_hash
+    {
+      static constexpr bool __enable_hash_call = false;
+    private:
+      // Private rather than deleted to be non-trivially-copyable.
+      __poison_hash(__poison_hash&&);
+      ~__poison_hash();
+    };
+
+  template<typename _Tp>
+    struct __poison_hash<_Tp, __void_t<decltype(hash<_Tp>()(declval<_Tp>()))>>
+    {
+      static constexpr bool __enable_hash_call = true;
+    };
+
+  // Helper struct for SFINAE-poisoning non-enum types.
+  template<typename _Tp, bool = is_enum<_Tp>::value>
+    struct __hash_enum
+    {
+    private:
+      // Private rather than deleted to be non-trivially-copyable.
+      __hash_enum(__hash_enum&&);
+      ~__hash_enum();
+    };
+
+  // Helper struct for hash with enum types.
+  template<typename _Tp>
+    struct __hash_enum<_Tp, true> : public __hash_base<size_t, _Tp>
+    {
+      size_t
+      operator()(_Tp __val) const noexcept
+      {
+       using __type = typename underlying_type<_Tp>::type;
+       return hash<__type>{}(static_cast<__type>(__val));
+      }
+    };
+
+  /// Primary class template hash, usable for enum types only.
+  // Use with non-enum types still SFINAES.
+  template<typename _Tp>
+    struct hash : __hash_enum<_Tp>
+    { };
+
+  /// Partial specializations for pointer types.
+  template<typename _Tp>
+    struct hash<_Tp*> : public __hash_base<size_t, _Tp*>
+    {
+      size_t
+      operator()(_Tp* __p) const noexcept
+      { return reinterpret_cast<size_t>(__p); }
+    };
+
+  // Explicit specializations for integer types.
+#define _Cxx_hashtable_define_trivial_hash(_Tp) 	\
+  template<>						\
+    struct hash<_Tp> : public __hash_base<size_t, _Tp>  \
+    {                                                   \
+      size_t                                            \
+      operator()(_Tp __val) const noexcept              \
+      { return static_cast<size_t>(__val); }            \
+    };
+
+  /// Explicit specialization for bool.
+  _Cxx_hashtable_define_trivial_hash(bool)
+
+  /// Explicit specialization for char.
+  _Cxx_hashtable_define_trivial_hash(char)
+
+  /// Explicit specialization for signed char.
+  _Cxx_hashtable_define_trivial_hash(signed char)
+
+  /// Explicit specialization for unsigned char.
+  _Cxx_hashtable_define_trivial_hash(unsigned char)
+
+  /// Explicit specialization for wchar_t.
+  _Cxx_hashtable_define_trivial_hash(wchar_t)
+
+  /// Explicit specialization for char16_t.
+  _Cxx_hashtable_define_trivial_hash(char16_t)
+
+  /// Explicit specialization for char32_t.
+  _Cxx_hashtable_define_trivial_hash(char32_t)
+
+  /// Explicit specialization for short.
+  _Cxx_hashtable_define_trivial_hash(short)
+
+  /// Explicit specialization for int.
+  _Cxx_hashtable_define_trivial_hash(int)
+
+  /// Explicit specialization for long.
+  _Cxx_hashtable_define_trivial_hash(long)
+
+  /// Explicit specialization for long long.
+  _Cxx_hashtable_define_trivial_hash(long long)
+
+  /// Explicit specialization for unsigned short.
+  _Cxx_hashtable_define_trivial_hash(unsigned short)
+
+  /// Explicit specialization for unsigned int.
+  _Cxx_hashtable_define_trivial_hash(unsigned int)
+
+  /// Explicit specialization for unsigned long.
+  _Cxx_hashtable_define_trivial_hash(unsigned long)
+
+  /// Explicit specialization for unsigned long long.
+  _Cxx_hashtable_define_trivial_hash(unsigned long long)
+
+#ifdef __GLIBCXX_TYPE_INT_N_0
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_0)
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_0 unsigned)
+#endif
+#ifdef __GLIBCXX_TYPE_INT_N_1
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_1)
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_1 unsigned)
+#endif
+#ifdef __GLIBCXX_TYPE_INT_N_2
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_2)
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_2 unsigned)
+#endif
+#ifdef __GLIBCXX_TYPE_INT_N_3
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_3)
+  _Cxx_hashtable_define_trivial_hash(__GLIBCXX_TYPE_INT_N_3 unsigned)
+#endif
+
+#undef _Cxx_hashtable_define_trivial_hash
+
+  struct _Hash_impl
+  {
+    static size_t
+    hash(const void* __ptr, size_t __clength,
+	 size_t __seed = static_cast<size_t>(0xc70f6907UL))
+    { return _Hash_bytes(__ptr, __clength, __seed); }
+
+    template<typename _Tp>
+      static size_t
+      hash(const _Tp& __val)
+      { return hash(&__val, sizeof(__val)); }
+
+    template<typename _Tp>
+      static size_t
+      __hash_combine(const _Tp& __val, size_t __hash)
+      { return hash(&__val, sizeof(__val), __hash); }
+  };
+
+  // A hash function similar to FNV-1a (see PR59406 for how it differs).
+  struct _Fnv_hash_impl
+  {
+    static size_t
+    hash(const void* __ptr, size_t __clength,
+	 size_t __seed = static_cast<size_t>(2166136261UL))
+    { return _Fnv_hash_bytes(__ptr, __clength, __seed); }
+
+    template<typename _Tp>
+      static size_t
+      hash(const _Tp& __val)
+      { return hash(&__val, sizeof(__val)); }
+
+    template<typename _Tp>
+      static size_t
+      __hash_combine(const _Tp& __val, size_t __hash)
+      { return hash(&__val, sizeof(__val), __hash); }
+  };
+
+  /// Specialization for float.
+  template<>
+    struct hash<float> : public __hash_base<size_t, float>
+    {
+      size_t
+      operator()(float __val) const noexcept
+      {
+	// 0 and -0 both hash to zero.
+	return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
+      }
+    };
+
+  /// Specialization for double.
+  template<>
+    struct hash<double> : public __hash_base<size_t, double>
+    {
+      size_t
+      operator()(double __val) const noexcept
+      {
+	// 0 and -0 both hash to zero.
+	return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
+      }
+    };
+
+  /// Specialization for long double.
+  template<>
+    struct hash<long double>
+    : public __hash_base<size_t, long double>
+    {
+      _GLIBCXX_PURE size_t
+      operator()(long double __val) const noexcept;
+    };
+
+  // @} group hashes
+
+  // Hint about performance of hash functor. If not fast the hash-based
+  // containers will cache the hash code.
+  // Default behavior is to consider that hashers are fast unless specified
+  // otherwise.
+  template<typename _Hash>
+    struct __is_fast_hash : public std::true_type
+    { };
+
+  template<>
+    struct __is_fast_hash<hash<long double>> : public std::false_type
+    { };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif // _FUNCTIONAL_HASH_H

+ 185 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/gslice.h

@@ -0,0 +1,185 @@
+// The template and inlines for the -*- C++ -*- gslice class.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/gslice.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{valarray}
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GSLICE_H
+#define _GSLICE_H 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @addtogroup numeric_arrays
+   * @{
+   */
+
+  /**
+   *  @brief  Class defining multi-dimensional subset of an array.
+   *
+   *  The slice class represents a multi-dimensional subset of an array,
+   *  specified by three parameter sets: start offset, size array, and stride
+   *  array.  The start offset is the index of the first element of the array
+   *  that is part of the subset.  The size and stride array describe each
+   *  dimension of the slice.  Size is the number of elements in that
+   *  dimension, and stride is the distance in the array between successive
+   *  elements in that dimension.  Each dimension's size and stride is taken
+   *  to begin at an array element described by the previous dimension.  The
+   *  size array and stride array must be the same size.
+   *
+   *  For example, if you have offset==3, stride[0]==11, size[1]==3,
+   *  stride[1]==3, then slice[0,0]==array[3], slice[0,1]==array[6],
+   *  slice[0,2]==array[9], slice[1,0]==array[14], slice[1,1]==array[17],
+   *  slice[1,2]==array[20].
+   */
+  class gslice
+  {
+  public:
+    ///  Construct an empty slice.
+    gslice();
+
+    /**
+     *  @brief  Construct a slice.
+     *
+     *  Constructs a slice with as many dimensions as the length of the @a l
+     *  and @a s arrays.
+     *
+     *  @param  __o  Offset in array of first element.
+     *  @param  __l  Array of dimension lengths.
+     *  @param  __s  Array of dimension strides between array elements.
+     */
+    gslice(size_t __o, const valarray<size_t>& __l, 
+	   const valarray<size_t>& __s);
+
+    // XXX: the IS says the copy-ctor and copy-assignment operators are
+    //      synthesized by the compiler but they are just unsuitable
+    //      for a ref-counted semantic
+    ///  Copy constructor.
+    gslice(const gslice&);
+
+    ///  Destructor.
+    ~gslice();
+
+    // XXX: See the note above.
+    ///  Assignment operator.
+    gslice& operator=(const gslice&);
+
+    ///  Return array offset of first slice element.
+    size_t           start() const;
+
+    ///  Return array of sizes of slice dimensions.
+    valarray<size_t> size() const;
+    
+    ///  Return array of array strides for each dimension.
+    valarray<size_t> stride() const;
+
+  private:
+    struct _Indexer
+    {
+      size_t _M_count;
+      size_t _M_start;
+      valarray<size_t> _M_size;
+      valarray<size_t> _M_stride;
+      valarray<size_t> _M_index; // Linear array of referenced indices
+
+      _Indexer()
+      : _M_count(1), _M_start(0), _M_size(), _M_stride(), _M_index() {}
+
+      _Indexer(size_t, const valarray<size_t>&,
+	       const valarray<size_t>&);
+
+      void
+      _M_increment_use()
+      { ++_M_count; }
+      
+      size_t
+      _M_decrement_use()
+      { return --_M_count; }
+    };
+
+    _Indexer* _M_index;
+
+    template<typename _Tp> friend class valarray;
+  };
+
+  inline size_t
+  gslice::start() const
+  { return _M_index ? _M_index->_M_start : 0; }
+
+  inline valarray<size_t>
+  gslice::size() const
+  { return _M_index ? _M_index->_M_size : valarray<size_t>(); }
+
+  inline valarray<size_t>
+  gslice::stride() const
+  { return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 543. valarray slice default constructor
+  inline
+  gslice::gslice()
+  : _M_index(new gslice::_Indexer()) {}
+
+  inline
+  gslice::gslice(size_t __o, const valarray<size_t>& __l,
+		 const valarray<size_t>& __s)
+  : _M_index(new gslice::_Indexer(__o, __l, __s)) {}
+
+  inline
+  gslice::gslice(const gslice& __g)
+  : _M_index(__g._M_index)
+  { if (_M_index) _M_index->_M_increment_use(); }
+
+  inline
+  gslice::~gslice()
+  {
+    if (_M_index && _M_index->_M_decrement_use() == 0)
+      delete _M_index;
+  }
+
+  inline gslice&
+  gslice::operator=(const gslice& __g)
+  {
+    if (__g._M_index)
+      __g._M_index->_M_increment_use();
+    if (_M_index && _M_index->_M_decrement_use() == 0)
+      delete _M_index;
+    _M_index = __g._M_index;
+    return *this;
+  }
+
+  // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _GSLICE_H */

+ 218 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/gslice_array.h

@@ -0,0 +1,218 @@
+// The template and inlines for the -*- C++ -*- gslice_array class.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/gslice_array.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{valarray}
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GSLICE_ARRAY_H
+#define _GSLICE_ARRAY_H 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @addtogroup numeric_arrays
+   * @{
+   */
+
+  /**
+   *  @brief  Reference to multi-dimensional subset of an array.
+   *
+   *  A gslice_array is a reference to the actual elements of an array
+   *  specified by a gslice.  The way to get a gslice_array is to call
+   *  operator[](gslice) on a valarray.  The returned gslice_array then
+   *  permits carrying operations out on the referenced subset of elements in
+   *  the original valarray.  For example, operator+=(valarray) will add
+   *  values to the subset of elements in the underlying valarray this
+   *  gslice_array refers to.
+   *
+   *  @param  Tp  Element type.
+   */
+  template<typename _Tp>
+    class gslice_array
+    {
+    public:
+      typedef _Tp value_type;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
+      ///  Copy constructor.  Both slices refer to the same underlying array.
+      gslice_array(const gslice_array&);
+
+      ///  Assignment operator.  Assigns slice elements to corresponding
+      ///  elements of @a a.
+      gslice_array& operator=(const gslice_array&);
+
+      ///  Assign slice elements to corresponding elements of @a v.
+      void operator=(const valarray<_Tp>&) const;
+      ///  Multiply slice elements by corresponding elements of @a v.
+      void operator*=(const valarray<_Tp>&) const;
+      ///  Divide slice elements by corresponding elements of @a v.
+      void operator/=(const valarray<_Tp>&) const;
+      ///  Modulo slice elements by corresponding elements of @a v.
+      void operator%=(const valarray<_Tp>&) const;
+      ///  Add corresponding elements of @a v to slice elements.
+      void operator+=(const valarray<_Tp>&) const;
+      ///  Subtract corresponding elements of @a v from slice elements.
+      void operator-=(const valarray<_Tp>&) const;
+      ///  Logical xor slice elements with corresponding elements of @a v.
+      void operator^=(const valarray<_Tp>&) const;
+      ///  Logical and slice elements with corresponding elements of @a v.
+      void operator&=(const valarray<_Tp>&) const;
+      ///  Logical or slice elements with corresponding elements of @a v.
+      void operator|=(const valarray<_Tp>&) const;
+      ///  Left shift slice elements by corresponding elements of @a v.
+      void operator<<=(const valarray<_Tp>&) const;
+      ///  Right shift slice elements by corresponding elements of @a v.
+      void operator>>=(const valarray<_Tp>&) const;
+      ///  Assign all slice elements to @a t.
+      void operator=(const _Tp&) const;
+
+      template<class _Dom>
+        void operator=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator*=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator/=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator%=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator+=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator-=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator^=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator&=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator|=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator<<=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+        void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+    private:
+      _Array<_Tp>    _M_array;
+      const valarray<size_t>& _M_index;
+
+      friend class valarray<_Tp>;
+
+      gslice_array(_Array<_Tp>, const valarray<size_t>&);
+
+      // not implemented
+      gslice_array();
+    };
+
+  template<typename _Tp>
+    inline
+    gslice_array<_Tp>::gslice_array(_Array<_Tp> __a,
+				    const valarray<size_t>& __i)
+    : _M_array(__a), _M_index(__i) {}
+
+  template<typename _Tp>
+    inline
+    gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a)
+    : _M_array(__a._M_array), _M_index(__a._M_index) {}
+
+  template<typename _Tp>
+    inline gslice_array<_Tp>&
+    gslice_array<_Tp>::operator=(const gslice_array<_Tp>& __a)
+    {
+      std::__valarray_copy(_Array<_Tp>(__a._M_array),
+			   _Array<size_t>(__a._M_index), _M_index.size(),
+			   _M_array, _Array<size_t>(_M_index));
+      return *this;
+    }
+
+  template<typename _Tp>
+    inline void
+    gslice_array<_Tp>::operator=(const _Tp& __t) const
+    {
+      std::__valarray_fill(_M_array, _Array<size_t>(_M_index),
+			   _M_index.size(), __t);
+    }
+
+  template<typename _Tp>
+    inline void
+    gslice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+    {
+      std::__valarray_copy(_Array<_Tp>(__v), __v.size(),
+			   _M_array, _Array<size_t>(_M_index));
+    }
+
+  template<typename _Tp>
+    template<class _Dom>
+      inline void
+      gslice_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const
+      {
+	std::__valarray_copy (__e, _M_index.size(), _M_array,
+			      _Array<size_t>(_M_index));
+      }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)				\
+  template<typename _Tp>						\
+    inline void								\
+    gslice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const	\
+    {									\
+      _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index),	\
+			       _Array<_Tp>(__v), __v.size());		\
+    }									\
+									\
+  template<typename _Tp>                                                \
+    template<class _Dom>				                \
+      inline void							\
+      gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\
+      {									\
+	_Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\
+				 _M_index.size());			\
+      }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+  // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _GSLICE_ARRAY_H */

+ 59 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/hash_bytes.h

@@ -0,0 +1,59 @@
+// Declarations for hash functions. -*- C++ -*-
+
+// Copyright (C) 2010-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/hash_bytes.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{functional}
+ */
+
+#ifndef _HASH_BYTES_H
+#define _HASH_BYTES_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Hash function implementation for the nontrivial specialization.
+  // All of them are based on a primitive that hashes a pointer to a
+  // byte array. The actual hash algorithm is not guaranteed to stay
+  // the same from release to release -- it may be updated or tuned to
+  // improve hash quality or speed.
+  size_t
+  _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+  // A similar hash primitive, using the FNV hash algorithm. This
+  // algorithm is guaranteed to stay the same from release to release.
+  // (although it might not produce the same values on different
+  // machines.)
+  size_t
+  _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 2219 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/hashtable.h

@@ -0,0 +1,2219 @@
+// hashtable.h header -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/hashtable.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{unordered_map, unordered_set}
+ */
+
+#ifndef _HASHTABLE_H
+#define _HASHTABLE_H 1
+
+#pragma GCC system_header
+
+#include <bits/hashtable_policy.h>
+#if __cplusplus > 201402L
+# include <bits/node_handle.h>
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _Tp, typename _Hash>
+    using __cache_default
+      =  __not_<__and_<// Do not cache for fast hasher.
+		       __is_fast_hash<_Hash>,
+		       // Mandatory to have erase not throwing.
+		       __detail::__is_noexcept_hash<_Tp, _Hash>>>;
+
+  /**
+   *  Primary class template _Hashtable.
+   *
+   *  @ingroup hashtable-detail
+   *
+   *  @tparam _Value  CopyConstructible type.
+   *
+   *  @tparam _Key    CopyConstructible type.
+   *
+   *  @tparam _Alloc  An allocator type
+   *  ([lib.allocator.requirements]) whose _Alloc::value_type is
+   *  _Value.  As a conforming extension, we allow for
+   *  _Alloc::value_type != _Value.
+   *
+   *  @tparam _ExtractKey  Function object that takes an object of type
+   *  _Value and returns a value of type _Key.
+   *
+   *  @tparam _Equal  Function object that takes two objects of type k
+   *  and returns a bool-like value that is true if the two objects
+   *  are considered equal.
+   *
+   *  @tparam _H1  The hash function. A unary function object with
+   *  argument type _Key and result type size_t. Return values should
+   *  be distributed over the entire range [0, numeric_limits<size_t>:::max()].
+   *
+   *  @tparam _H2  The range-hashing function (in the terminology of
+   *  Tavori and Dreizin).  A binary function object whose argument
+   *  types and result type are all size_t.  Given arguments r and N,
+   *  the return value is in the range [0, N).
+   *
+   *  @tparam _Hash  The ranged hash function (Tavori and Dreizin). A
+   *  binary function whose argument types are _Key and size_t and
+   *  whose result type is size_t.  Given arguments k and N, the
+   *  return value is in the range [0, N).  Default: hash(k, N) =
+   *  h2(h1(k), N).  If _Hash is anything other than the default, _H1
+   *  and _H2 are ignored.
+   *
+   *  @tparam _RehashPolicy  Policy class with three members, all of
+   *  which govern the bucket count. _M_next_bkt(n) returns a bucket
+   *  count no smaller than n.  _M_bkt_for_elements(n) returns a
+   *  bucket count appropriate for an element count of n.
+   *  _M_need_rehash(n_bkt, n_elt, n_ins) determines whether, if the
+   *  current bucket count is n_bkt and the current element count is
+   *  n_elt, we need to increase the bucket count.  If so, returns
+   *  make_pair(true, n), where n is the new bucket count.  If not,
+   *  returns make_pair(false, <anything>)
+   *
+   *  @tparam _Traits  Compile-time class with three boolean
+   *  std::integral_constant members:  __cache_hash_code, __constant_iterators,
+   *   __unique_keys.
+   *
+   *  Each _Hashtable data structure has:
+   *
+   *  - _Bucket[]       _M_buckets
+   *  - _Hash_node_base _M_before_begin
+   *  - size_type       _M_bucket_count
+   *  - size_type       _M_element_count
+   *
+   *  with _Bucket being _Hash_node* and _Hash_node containing:
+   *
+   *  - _Hash_node*   _M_next
+   *  - Tp            _M_value
+   *  - size_t        _M_hash_code if cache_hash_code is true
+   *
+   *  In terms of Standard containers the hashtable is like the aggregation of:
+   *
+   *  - std::forward_list<_Node> containing the elements
+   *  - std::vector<std::forward_list<_Node>::iterator> representing the buckets
+   *
+   *  The non-empty buckets contain the node before the first node in the
+   *  bucket. This design makes it possible to implement something like a
+   *  std::forward_list::insert_after on container insertion and
+   *  std::forward_list::erase_after on container erase
+   *  calls. _M_before_begin is equivalent to
+   *  std::forward_list::before_begin. Empty buckets contain
+   *  nullptr.  Note that one of the non-empty buckets contains
+   *  &_M_before_begin which is not a dereferenceable node so the
+   *  node pointer in a bucket shall never be dereferenced, only its
+   *  next node can be.
+   *
+   *  Walking through a bucket's nodes requires a check on the hash code to
+   *  see if each node is still in the bucket. Such a design assumes a
+   *  quite efficient hash functor and is one of the reasons it is
+   *  highly advisable to set __cache_hash_code to true.
+   *
+   *  The container iterators are simply built from nodes. This way
+   *  incrementing the iterator is perfectly efficient independent of
+   *  how many empty buckets there are in the container.
+   *
+   *  On insert we compute the element's hash code and use it to find the
+   *  bucket index. If the element must be inserted in an empty bucket
+   *  we add it at the beginning of the singly linked list and make the
+   *  bucket point to _M_before_begin. The bucket that used to point to
+   *  _M_before_begin, if any, is updated to point to its new before
+   *  begin node.
+   *
+   *  On erase, the simple iterator design requires using the hash
+   *  functor to get the index of the bucket to update. For this
+   *  reason, when __cache_hash_code is set to false the hash functor must
+   *  not throw and this is enforced by a static assertion.
+   *
+   *  Functionality is implemented by decomposition into base classes,
+   *  where the derived _Hashtable class is used in _Map_base,
+   *  _Insert, _Rehash_base, and _Equality base classes to access the
+   *  "this" pointer. _Hashtable_base is used in the base classes as a
+   *  non-recursive, fully-completed-type so that detailed nested type
+   *  information, such as iterator type and node type, can be
+   *  used. This is similar to the "Curiously Recurring Template
+   *  Pattern" (CRTP) technique, but uses a reconstructed, not
+   *  explicitly passed, template pattern.
+   *
+   *  Base class templates are: 
+   *    - __detail::_Hashtable_base
+   *    - __detail::_Map_base
+   *    - __detail::_Insert
+   *    - __detail::_Rehash_base
+   *    - __detail::_Equality
+   */
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    class _Hashtable
+    : public __detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal,
+				       _H1, _H2, _Hash, _Traits>,
+      public __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+				 _H1, _H2, _Hash, _RehashPolicy, _Traits>,
+      public __detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+			       _H1, _H2, _Hash, _RehashPolicy, _Traits>,
+      public __detail::_Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+				    _H1, _H2, _Hash, _RehashPolicy, _Traits>,
+      public __detail::_Equality<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+				 _H1, _H2, _Hash, _RehashPolicy, _Traits>,
+      private __detail::_Hashtable_alloc<
+	__alloc_rebind<_Alloc,
+		       __detail::_Hash_node<_Value,
+					    _Traits::__hash_cached::value>>>
+    {
+      using __traits_type = _Traits;
+      using __hash_cached = typename __traits_type::__hash_cached;
+      using __node_type = __detail::_Hash_node<_Value, __hash_cached::value>;
+      using __node_alloc_type = __alloc_rebind<_Alloc, __node_type>;
+
+      using __hashtable_alloc = __detail::_Hashtable_alloc<__node_alloc_type>;
+
+      using __value_alloc_traits =
+	typename __hashtable_alloc::__value_alloc_traits;
+      using __node_alloc_traits =
+	typename __hashtable_alloc::__node_alloc_traits;
+      using __node_base = typename __hashtable_alloc::__node_base;
+      using __bucket_type = typename __hashtable_alloc::__bucket_type;
+
+    public:
+      typedef _Key						key_type;
+      typedef _Value						value_type;
+      typedef _Alloc						allocator_type;
+      typedef _Equal						key_equal;
+
+      // mapped_type, if present, comes from _Map_base.
+      // hasher, if present, comes from _Hash_code_base/_Hashtable_base.
+      typedef typename __value_alloc_traits::pointer		pointer;
+      typedef typename __value_alloc_traits::const_pointer	const_pointer;
+      typedef value_type&					reference;
+      typedef const value_type&					const_reference;
+
+    private:
+      using __rehash_type = _RehashPolicy;
+      using __rehash_state = typename __rehash_type::_State;
+
+      using __constant_iterators = typename __traits_type::__constant_iterators;
+      using __unique_keys = typename __traits_type::__unique_keys;
+
+      using __key_extract = typename std::conditional<
+					     __constant_iterators::value,
+				       	     __detail::_Identity,
+					     __detail::_Select1st>::type;
+
+      using __hashtable_base = __detail::
+			       _Hashtable_base<_Key, _Value, _ExtractKey,
+					      _Equal, _H1, _H2, _Hash, _Traits>;
+
+      using __hash_code_base =  typename __hashtable_base::__hash_code_base;
+      using __hash_code =  typename __hashtable_base::__hash_code;
+      using __ireturn_type = typename __hashtable_base::__ireturn_type;
+
+      using __map_base = __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey,
+					     _Equal, _H1, _H2, _Hash,
+					     _RehashPolicy, _Traits>;
+
+      using __rehash_base = __detail::_Rehash_base<_Key, _Value, _Alloc,
+						   _ExtractKey, _Equal,
+						   _H1, _H2, _Hash,
+						   _RehashPolicy, _Traits>;
+
+      using __eq_base = __detail::_Equality<_Key, _Value, _Alloc, _ExtractKey,
+					    _Equal, _H1, _H2, _Hash,
+					    _RehashPolicy, _Traits>;
+
+      using __reuse_or_alloc_node_type =
+	__detail::_ReuseOrAllocNode<__node_alloc_type>;
+
+      // Metaprogramming for picking apart hash caching.
+      template<typename _Cond>
+	using __if_hash_cached = __or_<__not_<__hash_cached>, _Cond>;
+
+      template<typename _Cond>
+	using __if_hash_not_cached = __or_<__hash_cached, _Cond>;
+
+      // Compile-time diagnostics.
+
+      // _Hash_code_base has everything protected, so use this derived type to
+      // access it.
+      struct __hash_code_base_access : __hash_code_base
+      { using __hash_code_base::_M_bucket_index; };
+
+      // Getting a bucket index from a node shall not throw because it is used
+      // in methods (erase, swap...) that shall not throw.
+      static_assert(noexcept(declval<const __hash_code_base_access&>()
+			     ._M_bucket_index((const __node_type*)nullptr,
+					      (std::size_t)0)),
+		    "Cache the hash code or qualify your functors involved"
+		    " in hash code and bucket index computation with noexcept");
+
+      // Following two static assertions are necessary to guarantee
+      // that local_iterator will be default constructible.
+
+      // When hash codes are cached local iterator inherits from H2 functor
+      // which must then be default constructible.
+      static_assert(__if_hash_cached<is_default_constructible<_H2>>::value,
+		    "Functor used to map hash code to bucket index"
+		    " must be default constructible");
+
+      template<typename _Keya, typename _Valuea, typename _Alloca,
+	       typename _ExtractKeya, typename _Equala,
+	       typename _H1a, typename _H2a, typename _Hasha,
+	       typename _RehashPolicya, typename _Traitsa,
+	       bool _Unique_keysa>
+	friend struct __detail::_Map_base;
+
+      template<typename _Keya, typename _Valuea, typename _Alloca,
+	       typename _ExtractKeya, typename _Equala,
+	       typename _H1a, typename _H2a, typename _Hasha,
+	       typename _RehashPolicya, typename _Traitsa>
+	friend struct __detail::_Insert_base;
+
+      template<typename _Keya, typename _Valuea, typename _Alloca,
+	       typename _ExtractKeya, typename _Equala,
+	       typename _H1a, typename _H2a, typename _Hasha,
+	       typename _RehashPolicya, typename _Traitsa,
+	       bool _Constant_iteratorsa>
+	friend struct __detail::_Insert;
+
+    public:
+      using size_type = typename __hashtable_base::size_type;
+      using difference_type = typename __hashtable_base::difference_type;
+
+      using iterator = typename __hashtable_base::iterator;
+      using const_iterator = typename __hashtable_base::const_iterator;
+
+      using local_iterator = typename __hashtable_base::local_iterator;
+      using const_local_iterator = typename __hashtable_base::
+				   const_local_iterator;
+
+#if __cplusplus > 201402L
+      using node_type = _Node_handle<_Key, _Value, __node_alloc_type>;
+      using insert_return_type = _Node_insert_return<iterator, node_type>;
+#endif
+
+    private:
+      __bucket_type*		_M_buckets		= &_M_single_bucket;
+      size_type			_M_bucket_count		= 1;
+      __node_base		_M_before_begin;
+      size_type			_M_element_count	= 0;
+      _RehashPolicy		_M_rehash_policy;
+
+      // A single bucket used when only need for 1 bucket. Especially
+      // interesting in move semantic to leave hashtable with only 1 buckets
+      // which is not allocated so that we can have those operations noexcept
+      // qualified.
+      // Note that we can't leave hashtable with 0 bucket without adding
+      // numerous checks in the code to avoid 0 modulus.
+      __bucket_type		_M_single_bucket	= nullptr;
+
+      bool
+      _M_uses_single_bucket(__bucket_type* __bkts) const
+      { return __builtin_expect(__bkts == &_M_single_bucket, false); }
+
+      bool
+      _M_uses_single_bucket() const
+      { return _M_uses_single_bucket(_M_buckets); }
+
+      __hashtable_alloc&
+      _M_base_alloc() { return *this; }
+
+      __bucket_type*
+      _M_allocate_buckets(size_type __n)
+      {
+	if (__builtin_expect(__n == 1, false))
+	  {
+	    _M_single_bucket = nullptr;
+	    return &_M_single_bucket;
+	  }
+
+	return __hashtable_alloc::_M_allocate_buckets(__n);
+      }
+
+      void
+      _M_deallocate_buckets(__bucket_type* __bkts, size_type __n)
+      {
+	if (_M_uses_single_bucket(__bkts))
+	  return;
+
+	__hashtable_alloc::_M_deallocate_buckets(__bkts, __n);
+      }
+
+      void
+      _M_deallocate_buckets()
+      { _M_deallocate_buckets(_M_buckets, _M_bucket_count); }
+
+      // Gets bucket begin, deals with the fact that non-empty buckets contain
+      // their before begin node.
+      __node_type*
+      _M_bucket_begin(size_type __bkt) const;
+
+      __node_type*
+      _M_begin() const
+      { return static_cast<__node_type*>(_M_before_begin._M_nxt); }
+
+      template<typename _NodeGenerator>
+	void
+	_M_assign(const _Hashtable&, const _NodeGenerator&);
+
+      void
+      _M_move_assign(_Hashtable&&, std::true_type);
+
+      void
+      _M_move_assign(_Hashtable&&, std::false_type);
+
+      void
+      _M_reset() noexcept;
+
+      _Hashtable(const _H1& __h1, const _H2& __h2, const _Hash& __h,
+		 const _Equal& __eq, const _ExtractKey& __exk,
+		 const allocator_type& __a)
+	: __hashtable_base(__exk, __h1, __h2, __h, __eq),
+	  __hashtable_alloc(__node_alloc_type(__a))
+      { }
+
+    public:
+      // Constructor, destructor, assignment, swap
+      _Hashtable() = default;
+      _Hashtable(size_type __bucket_hint,
+		 const _H1&, const _H2&, const _Hash&,
+		 const _Equal&, const _ExtractKey&,
+		 const allocator_type&);
+
+      template<typename _InputIterator>
+	_Hashtable(_InputIterator __first, _InputIterator __last,
+		   size_type __bucket_hint,
+		   const _H1&, const _H2&, const _Hash&,
+		   const _Equal&, const _ExtractKey&,
+		   const allocator_type&);
+
+      _Hashtable(const _Hashtable&);
+
+      _Hashtable(_Hashtable&&) noexcept;
+
+      _Hashtable(const _Hashtable&, const allocator_type&);
+
+      _Hashtable(_Hashtable&&, const allocator_type&);
+
+      // Use delegating constructors.
+      explicit
+      _Hashtable(const allocator_type& __a)
+	: __hashtable_alloc(__node_alloc_type(__a))
+      { }
+
+      explicit
+      _Hashtable(size_type __n,
+		 const _H1& __hf = _H1(),
+		 const key_equal& __eql = key_equal(),
+		 const allocator_type& __a = allocator_type())
+      : _Hashtable(__n, __hf, _H2(), _Hash(), __eql,
+		   __key_extract(), __a)
+      { }
+
+      template<typename _InputIterator>
+	_Hashtable(_InputIterator __f, _InputIterator __l,
+		   size_type __n = 0,
+		   const _H1& __hf = _H1(),
+		   const key_equal& __eql = key_equal(),
+		   const allocator_type& __a = allocator_type())
+	: _Hashtable(__f, __l, __n, __hf, _H2(), _Hash(), __eql,
+		     __key_extract(), __a)
+	{ }
+
+      _Hashtable(initializer_list<value_type> __l,
+		 size_type __n = 0,
+		 const _H1& __hf = _H1(),
+		 const key_equal& __eql = key_equal(),
+		 const allocator_type& __a = allocator_type())
+      : _Hashtable(__l.begin(), __l.end(), __n, __hf, _H2(), _Hash(), __eql,
+		   __key_extract(), __a)
+      { }
+
+      _Hashtable&
+      operator=(const _Hashtable& __ht);
+
+      _Hashtable&
+      operator=(_Hashtable&& __ht)
+      noexcept(__node_alloc_traits::_S_nothrow_move()
+	       && is_nothrow_move_assignable<_H1>::value
+	       && is_nothrow_move_assignable<_Equal>::value)
+      {
+        constexpr bool __move_storage =
+	  __node_alloc_traits::_S_propagate_on_move_assign()
+	  || __node_alloc_traits::_S_always_equal();
+	_M_move_assign(std::move(__ht), __bool_constant<__move_storage>());
+	return *this;
+      }
+
+      _Hashtable&
+      operator=(initializer_list<value_type> __l)
+      {
+	__reuse_or_alloc_node_type __roan(_M_begin(), *this);
+	_M_before_begin._M_nxt = nullptr;
+	clear();
+	this->_M_insert_range(__l.begin(), __l.end(), __roan);
+	return *this;
+      }
+
+      ~_Hashtable() noexcept;
+
+      void
+      swap(_Hashtable&)
+      noexcept(__and_<__is_nothrow_swappable<_H1>,
+	                  __is_nothrow_swappable<_Equal>>::value);
+
+      // Basic container operations
+      iterator
+      begin() noexcept
+      { return iterator(_M_begin()); }
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(_M_begin()); }
+
+      iterator
+      end() noexcept
+      { return iterator(nullptr); }
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(nullptr); }
+
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(_M_begin()); }
+
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(nullptr); }
+
+      size_type
+      size() const noexcept
+      { return _M_element_count; }
+
+      bool
+      empty() const noexcept
+      { return size() == 0; }
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(this->_M_node_allocator()); }
+
+      size_type
+      max_size() const noexcept
+      { return __node_alloc_traits::max_size(this->_M_node_allocator()); }
+
+      // Observers
+      key_equal
+      key_eq() const
+      { return this->_M_eq(); }
+
+      // hash_function, if present, comes from _Hash_code_base.
+
+      // Bucket operations
+      size_type
+      bucket_count() const noexcept
+      { return _M_bucket_count; }
+
+      size_type
+      max_bucket_count() const noexcept
+      { return max_size(); }
+
+      size_type
+      bucket_size(size_type __n) const
+      { return std::distance(begin(__n), end(__n)); }
+
+      size_type
+      bucket(const key_type& __k) const
+      { return _M_bucket_index(__k, this->_M_hash_code(__k)); }
+
+      local_iterator
+      begin(size_type __n)
+      {
+	return local_iterator(*this, _M_bucket_begin(__n),
+			      __n, _M_bucket_count);
+      }
+
+      local_iterator
+      end(size_type __n)
+      { return local_iterator(*this, nullptr, __n, _M_bucket_count); }
+
+      const_local_iterator
+      begin(size_type __n) const
+      {
+	return const_local_iterator(*this, _M_bucket_begin(__n),
+				    __n, _M_bucket_count);
+      }
+
+      const_local_iterator
+      end(size_type __n) const
+      { return const_local_iterator(*this, nullptr, __n, _M_bucket_count); }
+
+      // DR 691.
+      const_local_iterator
+      cbegin(size_type __n) const
+      {
+	return const_local_iterator(*this, _M_bucket_begin(__n),
+				    __n, _M_bucket_count);
+      }
+
+      const_local_iterator
+      cend(size_type __n) const
+      { return const_local_iterator(*this, nullptr, __n, _M_bucket_count); }
+
+      float
+      load_factor() const noexcept
+      {
+	return static_cast<float>(size()) / static_cast<float>(bucket_count());
+      }
+
+      // max_load_factor, if present, comes from _Rehash_base.
+
+      // Generalization of max_load_factor.  Extension, not found in
+      // TR1.  Only useful if _RehashPolicy is something other than
+      // the default.
+      const _RehashPolicy&
+      __rehash_policy() const
+      { return _M_rehash_policy; }
+
+      void
+      __rehash_policy(const _RehashPolicy& __pol)
+      { _M_rehash_policy = __pol; }
+
+      // Lookup.
+      iterator
+      find(const key_type& __k);
+
+      const_iterator
+      find(const key_type& __k) const;
+
+      size_type
+      count(const key_type& __k) const;
+
+      std::pair<iterator, iterator>
+      equal_range(const key_type& __k);
+
+      std::pair<const_iterator, const_iterator>
+      equal_range(const key_type& __k) const;
+
+    protected:
+      // Bucket index computation helpers.
+      size_type
+      _M_bucket_index(__node_type* __n) const noexcept
+      { return __hash_code_base::_M_bucket_index(__n, _M_bucket_count); }
+
+      size_type
+      _M_bucket_index(const key_type& __k, __hash_code __c) const
+      { return __hash_code_base::_M_bucket_index(__k, __c, _M_bucket_count); }
+
+      // Find and insert helper functions and types
+      // Find the node before the one matching the criteria.
+      __node_base*
+      _M_find_before_node(size_type, const key_type&, __hash_code) const;
+
+      __node_type*
+      _M_find_node(size_type __bkt, const key_type& __key,
+		   __hash_code __c) const
+      {
+	__node_base* __before_n = _M_find_before_node(__bkt, __key, __c);
+	if (__before_n)
+	  return static_cast<__node_type*>(__before_n->_M_nxt);
+	return nullptr;
+      }
+
+      // Insert a node at the beginning of a bucket.
+      void
+      _M_insert_bucket_begin(size_type, __node_type*);
+
+      // Remove the bucket first node
+      void
+      _M_remove_bucket_begin(size_type __bkt, __node_type* __next_n,
+			     size_type __next_bkt);
+
+      // Get the node before __n in the bucket __bkt
+      __node_base*
+      _M_get_previous_node(size_type __bkt, __node_base* __n);
+
+      // Insert node with hash code __code, in bucket bkt if no rehash (assumes
+      // no element with its key already present). Take ownership of the node,
+      // deallocate it on exception.
+      iterator
+      _M_insert_unique_node(size_type __bkt, __hash_code __code,
+			    __node_type* __n);
+
+      // Insert node with hash code __code. Take ownership of the node,
+      // deallocate it on exception.
+      iterator
+      _M_insert_multi_node(__node_type* __hint,
+			   __hash_code __code, __node_type* __n);
+
+      template<typename... _Args>
+	std::pair<iterator, bool>
+	_M_emplace(std::true_type, _Args&&... __args);
+
+      template<typename... _Args>
+	iterator
+	_M_emplace(std::false_type __uk, _Args&&... __args)
+	{ return _M_emplace(cend(), __uk, std::forward<_Args>(__args)...); }
+
+      // Emplace with hint, useless when keys are unique.
+      template<typename... _Args>
+	iterator
+	_M_emplace(const_iterator, std::true_type __uk, _Args&&... __args)
+	{ return _M_emplace(__uk, std::forward<_Args>(__args)...).first; }
+
+      template<typename... _Args>
+	iterator
+	_M_emplace(const_iterator, std::false_type, _Args&&... __args);
+
+      template<typename _Arg, typename _NodeGenerator>
+	std::pair<iterator, bool>
+	_M_insert(_Arg&&, const _NodeGenerator&, std::true_type);
+
+      template<typename _Arg, typename _NodeGenerator>
+	iterator
+	_M_insert(_Arg&& __arg, const _NodeGenerator& __node_gen,
+		  std::false_type __uk)
+	{
+	  return _M_insert(cend(), std::forward<_Arg>(__arg), __node_gen,
+			   __uk);
+	}
+
+      // Insert with hint, not used when keys are unique.
+      template<typename _Arg, typename _NodeGenerator>
+	iterator
+	_M_insert(const_iterator, _Arg&& __arg,
+		  const _NodeGenerator& __node_gen, std::true_type __uk)
+	{
+	  return
+	    _M_insert(std::forward<_Arg>(__arg), __node_gen, __uk).first;
+	}
+
+      // Insert with hint when keys are not unique.
+      template<typename _Arg, typename _NodeGenerator>
+	iterator
+	_M_insert(const_iterator, _Arg&&,
+		  const _NodeGenerator&, std::false_type);
+
+      size_type
+      _M_erase(std::true_type, const key_type&);
+
+      size_type
+      _M_erase(std::false_type, const key_type&);
+
+      iterator
+      _M_erase(size_type __bkt, __node_base* __prev_n, __node_type* __n);
+
+    public:
+      // Emplace
+      template<typename... _Args>
+	__ireturn_type
+	emplace(_Args&&... __args)
+	{ return _M_emplace(__unique_keys(), std::forward<_Args>(__args)...); }
+
+      template<typename... _Args>
+	iterator
+	emplace_hint(const_iterator __hint, _Args&&... __args)
+	{
+	  return _M_emplace(__hint, __unique_keys(),
+			    std::forward<_Args>(__args)...);
+	}
+
+      // Insert member functions via inheritance.
+
+      // Erase
+      iterator
+      erase(const_iterator);
+
+      // LWG 2059.
+      iterator
+      erase(iterator __it)
+      { return erase(const_iterator(__it)); }
+
+      size_type
+      erase(const key_type& __k)
+      { return _M_erase(__unique_keys(), __k); }
+
+      iterator
+      erase(const_iterator, const_iterator);
+
+      void
+      clear() noexcept;
+
+      // Set number of buckets to be appropriate for container of n element.
+      void rehash(size_type __n);
+
+      // DR 1189.
+      // reserve, if present, comes from _Rehash_base.
+
+#if __cplusplus > 201402L
+      /// Re-insert an extracted node into a container with unique keys.
+      insert_return_type
+      _M_reinsert_node(node_type&& __nh)
+      {
+	insert_return_type __ret;
+	if (__nh.empty())
+	  __ret.position = end();
+	else
+	  {
+	    __glibcxx_assert(get_allocator() == __nh.get_allocator());
+
+	    const key_type& __k = __nh._M_key();
+	    __hash_code __code = this->_M_hash_code(__k);
+	    size_type __bkt = _M_bucket_index(__k, __code);
+	    if (__node_type* __n = _M_find_node(__bkt, __k, __code))
+	      {
+		__ret.node = std::move(__nh);
+		__ret.position = iterator(__n);
+		__ret.inserted = false;
+	      }
+	    else
+	      {
+		__ret.position
+		  = _M_insert_unique_node(__bkt, __code, __nh._M_ptr);
+		__nh._M_ptr = nullptr;
+		__ret.inserted = true;
+	      }
+	  }
+	return __ret;
+      }
+
+      /// Re-insert an extracted node into a container with equivalent keys.
+      iterator
+      _M_reinsert_node_multi(const_iterator __hint, node_type&& __nh)
+      {
+	iterator __ret;
+	if (__nh.empty())
+	  __ret = end();
+	else
+	  {
+	    __glibcxx_assert(get_allocator() == __nh.get_allocator());
+
+	    auto __code = this->_M_hash_code(__nh._M_key());
+	    auto __node = std::exchange(__nh._M_ptr, nullptr);
+	    // FIXME: this deallocates the node on exception.
+	    __ret = _M_insert_multi_node(__hint._M_cur, __code, __node);
+	  }
+	return __ret;
+      }
+
+      /// Extract a node.
+      node_type
+      extract(const_iterator __pos)
+      {
+	__node_type* __n = __pos._M_cur;
+	size_t __bkt = _M_bucket_index(__n);
+
+	// Look for previous node to unlink it from the erased one, this
+	// is why we need buckets to contain the before begin to make
+	// this search fast.
+	__node_base* __prev_n = _M_get_previous_node(__bkt, __n);
+
+	if (__prev_n == _M_buckets[__bkt])
+	  _M_remove_bucket_begin(__bkt, __n->_M_next(),
+	     __n->_M_nxt ? _M_bucket_index(__n->_M_next()) : 0);
+	else if (__n->_M_nxt)
+	  {
+	    size_type __next_bkt = _M_bucket_index(__n->_M_next());
+	    if (__next_bkt != __bkt)
+	      _M_buckets[__next_bkt] = __prev_n;
+	  }
+
+	__prev_n->_M_nxt = __n->_M_nxt;
+	__n->_M_nxt = nullptr;
+	--_M_element_count;
+	return { __n, this->_M_node_allocator() };
+      }
+
+      /// Extract a node.
+      node_type
+      extract(const _Key& __k)
+      {
+	node_type __nh;
+	auto __pos = find(__k);
+	if (__pos != end())
+	  __nh = extract(const_iterator(__pos));
+	return __nh;
+      }
+
+      /// Merge from a compatible container into one with unique keys.
+      template<typename _Compatible_Hashtable>
+	void
+	_M_merge_unique(_Compatible_Hashtable& __src) noexcept
+	{
+	  static_assert(is_same_v<typename _Compatible_Hashtable::node_type,
+	      node_type>, "Node types are compatible");
+	  __glibcxx_assert(get_allocator() == __src.get_allocator());
+
+	  for (auto __i = __src.begin(), __end = __src.end(); __i != __end;)
+	    {
+	      auto __pos = __i++;
+	      const key_type& __k = this->_M_extract()(__pos._M_cur->_M_v());
+	      __hash_code __code = this->_M_hash_code(__k);
+	      size_type __bkt = _M_bucket_index(__k, __code);
+	      if (_M_find_node(__bkt, __k, __code) == nullptr)
+		{
+		  auto __nh = __src.extract(__pos);
+		  _M_insert_unique_node(__bkt, __code, __nh._M_ptr);
+		  __nh._M_ptr = nullptr;
+		}
+	    }
+	}
+
+      /// Merge from a compatible container into one with equivalent keys.
+      template<typename _Compatible_Hashtable>
+	void
+	_M_merge_multi(_Compatible_Hashtable& __src) noexcept
+	{
+	  static_assert(is_same_v<typename _Compatible_Hashtable::node_type,
+	      node_type>, "Node types are compatible");
+	  __glibcxx_assert(get_allocator() == __src.get_allocator());
+
+	  this->reserve(size() + __src.size());
+	  for (auto __i = __src.begin(), __end = __src.end(); __i != __end;)
+	    _M_reinsert_node_multi(cend(), __src.extract(__i++));
+	}
+#endif // C++17
+
+    private:
+      // Helper rehash method used when keys are unique.
+      void _M_rehash_aux(size_type __n, std::true_type);
+
+      // Helper rehash method used when keys can be non-unique.
+      void _M_rehash_aux(size_type __n, std::false_type);
+
+      // Unconditionally change size of bucket array to n, restore
+      // hash policy state to __state on exception.
+      void _M_rehash(size_type __n, const __rehash_state& __state);
+    };
+
+
+  // Definitions of class template _Hashtable's out-of-line member functions.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_bucket_begin(size_type __bkt) const
+    -> __node_type*
+    {
+      __node_base* __n = _M_buckets[__bkt];
+      return __n ? static_cast<__node_type*>(__n->_M_nxt) : nullptr;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _Hashtable(size_type __bucket_hint,
+	       const _H1& __h1, const _H2& __h2, const _Hash& __h,
+	       const _Equal& __eq, const _ExtractKey& __exk,
+	       const allocator_type& __a)
+      : _Hashtable(__h1, __h2, __h, __eq, __exk, __a)
+    {
+      auto __bkt = _M_rehash_policy._M_next_bkt(__bucket_hint);
+      if (__bkt > _M_bucket_count)
+	{
+	  _M_buckets = _M_allocate_buckets(__bkt);
+	  _M_bucket_count = __bkt;
+	}
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    template<typename _InputIterator>
+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		 _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+      _Hashtable(_InputIterator __f, _InputIterator __l,
+		 size_type __bucket_hint,
+		 const _H1& __h1, const _H2& __h2, const _Hash& __h,
+		 const _Equal& __eq, const _ExtractKey& __exk,
+		 const allocator_type& __a)
+	: _Hashtable(__h1, __h2, __h, __eq, __exk, __a)
+      {
+	auto __nb_elems = __detail::__distance_fw(__f, __l);
+	auto __bkt_count =
+	  _M_rehash_policy._M_next_bkt(
+	    std::max(_M_rehash_policy._M_bkt_for_elements(__nb_elems),
+		     __bucket_hint));
+
+	if (__bkt_count > _M_bucket_count)
+	  {
+	    _M_buckets = _M_allocate_buckets(__bkt_count);
+	    _M_bucket_count = __bkt_count;
+	  }
+
+	for (; __f != __l; ++__f)
+	  this->insert(*__f);
+      }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    operator=(const _Hashtable& __ht)
+    -> _Hashtable&
+    {
+      if (&__ht == this)
+	return *this;
+
+      if (__node_alloc_traits::_S_propagate_on_copy_assign())
+	{
+	  auto& __this_alloc = this->_M_node_allocator();
+	  auto& __that_alloc = __ht._M_node_allocator();
+	  if (!__node_alloc_traits::_S_always_equal()
+	      && __this_alloc != __that_alloc)
+	    {
+	      // Replacement allocator cannot free existing storage.
+	      this->_M_deallocate_nodes(_M_begin());
+	      _M_before_begin._M_nxt = nullptr;
+	      _M_deallocate_buckets();
+	      _M_buckets = nullptr;
+	      std::__alloc_on_copy(__this_alloc, __that_alloc);
+	      __hashtable_base::operator=(__ht);
+	      _M_bucket_count = __ht._M_bucket_count;
+	      _M_element_count = __ht._M_element_count;
+	      _M_rehash_policy = __ht._M_rehash_policy;
+	      __try
+		{
+		  _M_assign(__ht,
+			    [this](const __node_type* __n)
+			    { return this->_M_allocate_node(__n->_M_v()); });
+		}
+	      __catch(...)
+		{
+		  // _M_assign took care of deallocating all memory. Now we
+		  // must make sure this instance remains in a usable state.
+		  _M_reset();
+		  __throw_exception_again;
+		}
+	      return *this;
+	    }
+	  std::__alloc_on_copy(__this_alloc, __that_alloc);
+	}
+
+      // Reuse allocated buckets and nodes.
+      __bucket_type* __former_buckets = nullptr;
+      std::size_t __former_bucket_count = _M_bucket_count;
+      const __rehash_state& __former_state = _M_rehash_policy._M_state();
+
+      if (_M_bucket_count != __ht._M_bucket_count)
+	{
+	  __former_buckets = _M_buckets;
+	  _M_buckets = _M_allocate_buckets(__ht._M_bucket_count);
+	  _M_bucket_count = __ht._M_bucket_count;
+	}
+      else
+	__builtin_memset(_M_buckets, 0,
+			 _M_bucket_count * sizeof(__bucket_type));
+
+      __try
+	{
+	  __hashtable_base::operator=(__ht);
+	  _M_element_count = __ht._M_element_count;
+	  _M_rehash_policy = __ht._M_rehash_policy;
+	  __reuse_or_alloc_node_type __roan(_M_begin(), *this);
+	  _M_before_begin._M_nxt = nullptr;
+	  _M_assign(__ht,
+		    [&__roan](const __node_type* __n)
+		    { return __roan(__n->_M_v()); });
+	  if (__former_buckets)
+	    _M_deallocate_buckets(__former_buckets, __former_bucket_count);
+	}
+      __catch(...)
+	{
+	  if (__former_buckets)
+	    {
+	      // Restore previous buckets.
+	      _M_deallocate_buckets();
+	      _M_rehash_policy._M_reset(__former_state);
+	      _M_buckets = __former_buckets;
+	      _M_bucket_count = __former_bucket_count;
+	    }
+	  __builtin_memset(_M_buckets, 0,
+			   _M_bucket_count * sizeof(__bucket_type));
+	  __throw_exception_again;
+	}
+      return *this;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    template<typename _NodeGenerator>
+      void
+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		 _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+      _M_assign(const _Hashtable& __ht, const _NodeGenerator& __node_gen)
+      {
+	__bucket_type* __buckets = nullptr;
+	if (!_M_buckets)
+	  _M_buckets = __buckets = _M_allocate_buckets(_M_bucket_count);
+
+	__try
+	  {
+	    if (!__ht._M_before_begin._M_nxt)
+	      return;
+
+	    // First deal with the special first node pointed to by
+	    // _M_before_begin.
+	    __node_type* __ht_n = __ht._M_begin();
+	    __node_type* __this_n = __node_gen(__ht_n);
+	    this->_M_copy_code(__this_n, __ht_n);
+	    _M_before_begin._M_nxt = __this_n;
+	    _M_buckets[_M_bucket_index(__this_n)] = &_M_before_begin;
+
+	    // Then deal with other nodes.
+	    __node_base* __prev_n = __this_n;
+	    for (__ht_n = __ht_n->_M_next(); __ht_n; __ht_n = __ht_n->_M_next())
+	      {
+		__this_n = __node_gen(__ht_n);
+		__prev_n->_M_nxt = __this_n;
+		this->_M_copy_code(__this_n, __ht_n);
+		size_type __bkt = _M_bucket_index(__this_n);
+		if (!_M_buckets[__bkt])
+		  _M_buckets[__bkt] = __prev_n;
+		__prev_n = __this_n;
+	      }
+	  }
+	__catch(...)
+	  {
+	    clear();
+	    if (__buckets)
+	      _M_deallocate_buckets();
+	    __throw_exception_again;
+	  }
+      }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_reset() noexcept
+    {
+      _M_rehash_policy._M_reset();
+      _M_bucket_count = 1;
+      _M_single_bucket = nullptr;
+      _M_buckets = &_M_single_bucket;
+      _M_before_begin._M_nxt = nullptr;
+      _M_element_count = 0;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_move_assign(_Hashtable&& __ht, std::true_type)
+    {
+      this->_M_deallocate_nodes(_M_begin());
+      _M_deallocate_buckets();
+      __hashtable_base::operator=(std::move(__ht));
+      _M_rehash_policy = __ht._M_rehash_policy;
+      if (!__ht._M_uses_single_bucket())
+	_M_buckets = __ht._M_buckets;
+      else
+	{
+	  _M_buckets = &_M_single_bucket;
+	  _M_single_bucket = __ht._M_single_bucket;
+	}
+      _M_bucket_count = __ht._M_bucket_count;
+      _M_before_begin._M_nxt = __ht._M_before_begin._M_nxt;
+      _M_element_count = __ht._M_element_count;
+      std::__alloc_on_move(this->_M_node_allocator(), __ht._M_node_allocator());
+
+      // Fix buckets containing the _M_before_begin pointers that can't be
+      // moved.
+      if (_M_begin())
+	_M_buckets[_M_bucket_index(_M_begin())] = &_M_before_begin;
+      __ht._M_reset();
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_move_assign(_Hashtable&& __ht, std::false_type)
+    {
+      if (__ht._M_node_allocator() == this->_M_node_allocator())
+	_M_move_assign(std::move(__ht), std::true_type());
+      else
+	{
+	  // Can't move memory, move elements then.
+	  __bucket_type* __former_buckets = nullptr;
+	  size_type __former_bucket_count = _M_bucket_count;
+	  const __rehash_state& __former_state = _M_rehash_policy._M_state();
+
+	  if (_M_bucket_count != __ht._M_bucket_count)
+	    {
+	      __former_buckets = _M_buckets;
+	      _M_buckets = _M_allocate_buckets(__ht._M_bucket_count);
+	      _M_bucket_count = __ht._M_bucket_count;
+	    }
+	  else
+	    __builtin_memset(_M_buckets, 0,
+			     _M_bucket_count * sizeof(__bucket_type));
+
+	  __try
+	    {
+	      __hashtable_base::operator=(std::move(__ht));
+	      _M_element_count = __ht._M_element_count;
+	      _M_rehash_policy = __ht._M_rehash_policy;
+	      __reuse_or_alloc_node_type __roan(_M_begin(), *this);
+	      _M_before_begin._M_nxt = nullptr;
+	      _M_assign(__ht,
+			[&__roan](__node_type* __n)
+			{ return __roan(std::move_if_noexcept(__n->_M_v())); });
+
+	      if (__former_buckets)
+		_M_deallocate_buckets(__former_buckets, __former_bucket_count);
+	      __ht.clear();
+	    }
+	  __catch(...)
+	    {
+	      if (__former_buckets)
+		{
+		  _M_deallocate_buckets();
+		  _M_rehash_policy._M_reset(__former_state);
+		  _M_buckets = __former_buckets;
+		  _M_bucket_count = __former_bucket_count;
+		}
+	      __builtin_memset(_M_buckets, 0,
+			       _M_bucket_count * sizeof(__bucket_type));
+	      __throw_exception_again;
+	    }
+	}
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _Hashtable(const _Hashtable& __ht)
+    : __hashtable_base(__ht),
+      __map_base(__ht),
+      __rehash_base(__ht),
+      __hashtable_alloc(
+	__node_alloc_traits::_S_select_on_copy(__ht._M_node_allocator())),
+      _M_buckets(nullptr),
+      _M_bucket_count(__ht._M_bucket_count),
+      _M_element_count(__ht._M_element_count),
+      _M_rehash_policy(__ht._M_rehash_policy)
+    {
+      _M_assign(__ht,
+		[this](const __node_type* __n)
+		{ return this->_M_allocate_node(__n->_M_v()); });
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _Hashtable(_Hashtable&& __ht) noexcept
+    : __hashtable_base(__ht),
+      __map_base(__ht),
+      __rehash_base(__ht),
+      __hashtable_alloc(std::move(__ht._M_base_alloc())),
+      _M_buckets(__ht._M_buckets),
+      _M_bucket_count(__ht._M_bucket_count),
+      _M_before_begin(__ht._M_before_begin._M_nxt),
+      _M_element_count(__ht._M_element_count),
+      _M_rehash_policy(__ht._M_rehash_policy)
+    {
+      // Update, if necessary, buckets if __ht is using its single bucket.
+      if (__ht._M_uses_single_bucket())
+	{
+	  _M_buckets = &_M_single_bucket;
+	  _M_single_bucket = __ht._M_single_bucket;
+	}
+
+      // Update, if necessary, bucket pointing to before begin that hasn't
+      // moved.
+      if (_M_begin())
+	_M_buckets[_M_bucket_index(_M_begin())] = &_M_before_begin;
+
+      __ht._M_reset();
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _Hashtable(const _Hashtable& __ht, const allocator_type& __a)
+    : __hashtable_base(__ht),
+      __map_base(__ht),
+      __rehash_base(__ht),
+      __hashtable_alloc(__node_alloc_type(__a)),
+      _M_buckets(),
+      _M_bucket_count(__ht._M_bucket_count),
+      _M_element_count(__ht._M_element_count),
+      _M_rehash_policy(__ht._M_rehash_policy)
+    {
+      _M_assign(__ht,
+		[this](const __node_type* __n)
+		{ return this->_M_allocate_node(__n->_M_v()); });
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _Hashtable(_Hashtable&& __ht, const allocator_type& __a)
+    : __hashtable_base(__ht),
+      __map_base(__ht),
+      __rehash_base(__ht),
+      __hashtable_alloc(__node_alloc_type(__a)),
+      _M_buckets(nullptr),
+      _M_bucket_count(__ht._M_bucket_count),
+      _M_element_count(__ht._M_element_count),
+      _M_rehash_policy(__ht._M_rehash_policy)
+    {
+      if (__ht._M_node_allocator() == this->_M_node_allocator())
+	{
+	  if (__ht._M_uses_single_bucket())
+	    {
+	      _M_buckets = &_M_single_bucket;
+	      _M_single_bucket = __ht._M_single_bucket;
+	    }
+	  else
+	    _M_buckets = __ht._M_buckets;
+
+	  _M_before_begin._M_nxt = __ht._M_before_begin._M_nxt;
+	  // Update, if necessary, bucket pointing to before begin that hasn't
+	  // moved.
+	  if (_M_begin())
+	    _M_buckets[_M_bucket_index(_M_begin())] = &_M_before_begin;
+	  __ht._M_reset();
+	}
+      else
+	{
+	  _M_assign(__ht,
+		    [this](__node_type* __n)
+		    {
+		      return this->_M_allocate_node(
+					std::move_if_noexcept(__n->_M_v()));
+		    });
+	  __ht.clear();
+	}
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    ~_Hashtable() noexcept
+    {
+      clear();
+      _M_deallocate_buckets();
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    swap(_Hashtable& __x)
+    noexcept(__and_<__is_nothrow_swappable<_H1>,
+	                __is_nothrow_swappable<_Equal>>::value)
+    {
+      // The only base class with member variables is hash_code_base.
+      // We define _Hash_code_base::_M_swap because different
+      // specializations have different members.
+      this->_M_swap(__x);
+
+      std::__alloc_on_swap(this->_M_node_allocator(), __x._M_node_allocator());
+      std::swap(_M_rehash_policy, __x._M_rehash_policy);
+
+      // Deal properly with potentially moved instances.
+      if (this->_M_uses_single_bucket())
+	{
+	  if (!__x._M_uses_single_bucket())
+	    {
+	      _M_buckets = __x._M_buckets;
+	      __x._M_buckets = &__x._M_single_bucket;
+	    }
+	}
+      else if (__x._M_uses_single_bucket())
+	{
+	  __x._M_buckets = _M_buckets;
+	  _M_buckets = &_M_single_bucket;
+	}	
+      else
+	std::swap(_M_buckets, __x._M_buckets);
+
+      std::swap(_M_bucket_count, __x._M_bucket_count);
+      std::swap(_M_before_begin._M_nxt, __x._M_before_begin._M_nxt);
+      std::swap(_M_element_count, __x._M_element_count);
+      std::swap(_M_single_bucket, __x._M_single_bucket);
+
+      // Fix buckets containing the _M_before_begin pointers that can't be
+      // swapped.
+      if (_M_begin())
+	_M_buckets[_M_bucket_index(_M_begin())] = &_M_before_begin;
+
+      if (__x._M_begin())
+	__x._M_buckets[__x._M_bucket_index(__x._M_begin())]
+	  = &__x._M_before_begin;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    find(const key_type& __k)
+    -> iterator
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __n = _M_bucket_index(__k, __code);
+      __node_type* __p = _M_find_node(__n, __k, __code);
+      return __p ? iterator(__p) : end();
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    find(const key_type& __k) const
+    -> const_iterator
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __n = _M_bucket_index(__k, __code);
+      __node_type* __p = _M_find_node(__n, __k, __code);
+      return __p ? const_iterator(__p) : end();
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    count(const key_type& __k) const
+    -> size_type
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __n = _M_bucket_index(__k, __code);
+      __node_type* __p = _M_bucket_begin(__n);
+      if (!__p)
+	return 0;
+
+      std::size_t __result = 0;
+      for (;; __p = __p->_M_next())
+	{
+	  if (this->_M_equals(__k, __code, __p))
+	    ++__result;
+	  else if (__result)
+	    // All equivalent values are next to each other, if we
+	    // found a non-equivalent value after an equivalent one it
+	    // means that we won't find any new equivalent value.
+	    break;
+	  if (!__p->_M_nxt || _M_bucket_index(__p->_M_next()) != __n)
+	    break;
+	}
+      return __result;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    equal_range(const key_type& __k)
+    -> pair<iterator, iterator>
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __n = _M_bucket_index(__k, __code);
+      __node_type* __p = _M_find_node(__n, __k, __code);
+
+      if (__p)
+	{
+	  __node_type* __p1 = __p->_M_next();
+	  while (__p1 && _M_bucket_index(__p1) == __n
+		 && this->_M_equals(__k, __code, __p1))
+	    __p1 = __p1->_M_next();
+
+	  return std::make_pair(iterator(__p), iterator(__p1));
+	}
+      else
+	return std::make_pair(end(), end());
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    equal_range(const key_type& __k) const
+    -> pair<const_iterator, const_iterator>
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __n = _M_bucket_index(__k, __code);
+      __node_type* __p = _M_find_node(__n, __k, __code);
+
+      if (__p)
+	{
+	  __node_type* __p1 = __p->_M_next();
+	  while (__p1 && _M_bucket_index(__p1) == __n
+		 && this->_M_equals(__k, __code, __p1))
+	    __p1 = __p1->_M_next();
+
+	  return std::make_pair(const_iterator(__p), const_iterator(__p1));
+	}
+      else
+	return std::make_pair(end(), end());
+    }
+
+  // Find the node whose key compares equal to k in the bucket n.
+  // Return nullptr if no node is found.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_find_before_node(size_type __n, const key_type& __k,
+			__hash_code __code) const
+    -> __node_base*
+    {
+      __node_base* __prev_p = _M_buckets[__n];
+      if (!__prev_p)
+	return nullptr;
+
+      for (__node_type* __p = static_cast<__node_type*>(__prev_p->_M_nxt);;
+	   __p = __p->_M_next())
+	{
+	  if (this->_M_equals(__k, __code, __p))
+	    return __prev_p;
+
+	  if (!__p->_M_nxt || _M_bucket_index(__p->_M_next()) != __n)
+	    break;
+	  __prev_p = __p;
+	}
+      return nullptr;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_insert_bucket_begin(size_type __bkt, __node_type* __node)
+    {
+      if (_M_buckets[__bkt])
+	{
+	  // Bucket is not empty, we just need to insert the new node
+	  // after the bucket before begin.
+	  __node->_M_nxt = _M_buckets[__bkt]->_M_nxt;
+	  _M_buckets[__bkt]->_M_nxt = __node;
+	}
+      else
+	{
+	  // The bucket is empty, the new node is inserted at the
+	  // beginning of the singly-linked list and the bucket will
+	  // contain _M_before_begin pointer.
+	  __node->_M_nxt = _M_before_begin._M_nxt;
+	  _M_before_begin._M_nxt = __node;
+	  if (__node->_M_nxt)
+	    // We must update former begin bucket that is pointing to
+	    // _M_before_begin.
+	    _M_buckets[_M_bucket_index(__node->_M_next())] = __node;
+	  _M_buckets[__bkt] = &_M_before_begin;
+	}
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_remove_bucket_begin(size_type __bkt, __node_type* __next,
+			   size_type __next_bkt)
+    {
+      if (!__next || __next_bkt != __bkt)
+	{
+	  // Bucket is now empty
+	  // First update next bucket if any
+	  if (__next)
+	    _M_buckets[__next_bkt] = _M_buckets[__bkt];
+
+	  // Second update before begin node if necessary
+	  if (&_M_before_begin == _M_buckets[__bkt])
+	    _M_before_begin._M_nxt = __next;
+	  _M_buckets[__bkt] = nullptr;
+	}
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_get_previous_node(size_type __bkt, __node_base* __n)
+    -> __node_base*
+    {
+      __node_base* __prev_n = _M_buckets[__bkt];
+      while (__prev_n->_M_nxt != __n)
+	__prev_n = __prev_n->_M_nxt;
+      return __prev_n;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    template<typename... _Args>
+      auto
+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		 _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+      _M_emplace(std::true_type, _Args&&... __args)
+      -> pair<iterator, bool>
+      {
+	// First build the node to get access to the hash code
+	__node_type* __node = this->_M_allocate_node(std::forward<_Args>(__args)...);
+	const key_type& __k = this->_M_extract()(__node->_M_v());
+	__hash_code __code;
+	__try
+	  {
+	    __code = this->_M_hash_code(__k);
+	  }
+	__catch(...)
+	  {
+	    this->_M_deallocate_node(__node);
+	    __throw_exception_again;
+	  }
+
+	size_type __bkt = _M_bucket_index(__k, __code);
+	if (__node_type* __p = _M_find_node(__bkt, __k, __code))
+	  {
+	    // There is already an equivalent node, no insertion
+	    this->_M_deallocate_node(__node);
+	    return std::make_pair(iterator(__p), false);
+	  }
+
+	// Insert the node
+	return std::make_pair(_M_insert_unique_node(__bkt, __code, __node),
+			      true);
+      }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    template<typename... _Args>
+      auto
+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		 _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+      _M_emplace(const_iterator __hint, std::false_type, _Args&&... __args)
+      -> iterator
+      {
+	// First build the node to get its hash code.
+	__node_type* __node =
+	  this->_M_allocate_node(std::forward<_Args>(__args)...);
+
+	__hash_code __code;
+	__try
+	  {
+	    __code = this->_M_hash_code(this->_M_extract()(__node->_M_v()));
+	  }
+	__catch(...)
+	  {
+	    this->_M_deallocate_node(__node);
+	    __throw_exception_again;
+	  }
+
+	return _M_insert_multi_node(__hint._M_cur, __code, __node);
+      }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_insert_unique_node(size_type __bkt, __hash_code __code,
+			  __node_type* __node)
+    -> iterator
+    {
+      const __rehash_state& __saved_state = _M_rehash_policy._M_state();
+      std::pair<bool, std::size_t> __do_rehash
+	= _M_rehash_policy._M_need_rehash(_M_bucket_count, _M_element_count, 1);
+
+      __try
+	{
+	  if (__do_rehash.first)
+	    {
+	      _M_rehash(__do_rehash.second, __saved_state);
+	      __bkt = _M_bucket_index(this->_M_extract()(__node->_M_v()), __code);
+	    }
+
+	  this->_M_store_code(__node, __code);
+
+	  // Always insert at the beginning of the bucket.
+	  _M_insert_bucket_begin(__bkt, __node);
+	  ++_M_element_count;
+	  return iterator(__node);
+	}
+      __catch(...)
+	{
+	  this->_M_deallocate_node(__node);
+	  __throw_exception_again;
+	}
+    }
+
+  // Insert node, in bucket bkt if no rehash (assumes no element with its key
+  // already present). Take ownership of the node, deallocate it on exception.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_insert_multi_node(__node_type* __hint, __hash_code __code,
+			 __node_type* __node)
+    -> iterator
+    {
+      const __rehash_state& __saved_state = _M_rehash_policy._M_state();
+      std::pair<bool, std::size_t> __do_rehash
+	= _M_rehash_policy._M_need_rehash(_M_bucket_count, _M_element_count, 1);
+
+      __try
+	{
+	  if (__do_rehash.first)
+	    _M_rehash(__do_rehash.second, __saved_state);
+
+	  this->_M_store_code(__node, __code);
+	  const key_type& __k = this->_M_extract()(__node->_M_v());
+	  size_type __bkt = _M_bucket_index(__k, __code);
+
+	  // Find the node before an equivalent one or use hint if it exists and
+	  // if it is equivalent.
+	  __node_base* __prev
+	    = __builtin_expect(__hint != nullptr, false)
+	      && this->_M_equals(__k, __code, __hint)
+		? __hint
+		: _M_find_before_node(__bkt, __k, __code);
+	  if (__prev)
+	    {
+	      // Insert after the node before the equivalent one.
+	      __node->_M_nxt = __prev->_M_nxt;
+	      __prev->_M_nxt = __node;
+	      if (__builtin_expect(__prev == __hint, false))
+	      	// hint might be the last bucket node, in this case we need to
+	      	// update next bucket.
+	      	if (__node->_M_nxt
+	      	    && !this->_M_equals(__k, __code, __node->_M_next()))
+	      	  {
+	      	    size_type __next_bkt = _M_bucket_index(__node->_M_next());
+	      	    if (__next_bkt != __bkt)
+	      	      _M_buckets[__next_bkt] = __node;
+	      	  }
+	    }
+	  else
+	    // The inserted node has no equivalent in the
+	    // hashtable. We must insert the new node at the
+	    // beginning of the bucket to preserve equivalent
+	    // elements' relative positions.
+	    _M_insert_bucket_begin(__bkt, __node);
+	  ++_M_element_count;
+	  return iterator(__node);
+	}
+      __catch(...)
+	{
+	  this->_M_deallocate_node(__node);
+	  __throw_exception_again;
+	}
+    }
+
+  // Insert v if no element with its key is already present.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    template<typename _Arg, typename _NodeGenerator>
+      auto
+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		 _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+      _M_insert(_Arg&& __v, const _NodeGenerator& __node_gen, std::true_type)
+      -> pair<iterator, bool>
+      {
+	const key_type& __k = this->_M_extract()(__v);
+	__hash_code __code = this->_M_hash_code(__k);
+	size_type __bkt = _M_bucket_index(__k, __code);
+
+	__node_type* __n = _M_find_node(__bkt, __k, __code);
+	if (__n)
+	  return std::make_pair(iterator(__n), false);
+
+	__n = __node_gen(std::forward<_Arg>(__v));
+	return std::make_pair(_M_insert_unique_node(__bkt, __code, __n), true);
+      }
+
+  // Insert v unconditionally.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    template<typename _Arg, typename _NodeGenerator>
+      auto
+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		 _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+      _M_insert(const_iterator __hint, _Arg&& __v,
+		const _NodeGenerator& __node_gen, std::false_type)
+      -> iterator
+      {
+	// First compute the hash code so that we don't do anything if it
+	// throws.
+	__hash_code __code = this->_M_hash_code(this->_M_extract()(__v));
+
+	// Second allocate new node so that we don't rehash if it throws.
+	__node_type* __node = __node_gen(std::forward<_Arg>(__v));
+
+	return _M_insert_multi_node(__hint._M_cur, __code, __node);
+      }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    erase(const_iterator __it)
+    -> iterator
+    {
+      __node_type* __n = __it._M_cur;
+      std::size_t __bkt = _M_bucket_index(__n);
+
+      // Look for previous node to unlink it from the erased one, this
+      // is why we need buckets to contain the before begin to make
+      // this search fast.
+      __node_base* __prev_n = _M_get_previous_node(__bkt, __n);
+      return _M_erase(__bkt, __prev_n, __n);
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_erase(size_type __bkt, __node_base* __prev_n, __node_type* __n)
+    -> iterator
+    {
+      if (__prev_n == _M_buckets[__bkt])
+	_M_remove_bucket_begin(__bkt, __n->_M_next(),
+	   __n->_M_nxt ? _M_bucket_index(__n->_M_next()) : 0);
+      else if (__n->_M_nxt)
+	{
+	  size_type __next_bkt = _M_bucket_index(__n->_M_next());
+	  if (__next_bkt != __bkt)
+	    _M_buckets[__next_bkt] = __prev_n;
+	}
+
+      __prev_n->_M_nxt = __n->_M_nxt;
+      iterator __result(__n->_M_next());
+      this->_M_deallocate_node(__n);
+      --_M_element_count;
+
+      return __result;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_erase(std::true_type, const key_type& __k)
+    -> size_type
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __bkt = _M_bucket_index(__k, __code);
+
+      // Look for the node before the first matching node.
+      __node_base* __prev_n = _M_find_before_node(__bkt, __k, __code);
+      if (!__prev_n)
+	return 0;
+
+      // We found a matching node, erase it.
+      __node_type* __n = static_cast<__node_type*>(__prev_n->_M_nxt);
+      _M_erase(__bkt, __prev_n, __n);
+      return 1;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_erase(std::false_type, const key_type& __k)
+    -> size_type
+    {
+      __hash_code __code = this->_M_hash_code(__k);
+      std::size_t __bkt = _M_bucket_index(__k, __code);
+
+      // Look for the node before the first matching node.
+      __node_base* __prev_n = _M_find_before_node(__bkt, __k, __code);
+      if (!__prev_n)
+	return 0;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 526. Is it undefined if a function in the standard changes
+      // in parameters?
+      // We use one loop to find all matching nodes and another to deallocate
+      // them so that the key stays valid during the first loop. It might be
+      // invalidated indirectly when destroying nodes.
+      __node_type* __n = static_cast<__node_type*>(__prev_n->_M_nxt);
+      __node_type* __n_last = __n;
+      std::size_t __n_last_bkt = __bkt;
+      do
+	{
+	  __n_last = __n_last->_M_next();
+	  if (!__n_last)
+	    break;
+	  __n_last_bkt = _M_bucket_index(__n_last);
+	}
+      while (__n_last_bkt == __bkt && this->_M_equals(__k, __code, __n_last));
+
+      // Deallocate nodes.
+      size_type __result = 0;
+      do
+	{
+	  __node_type* __p = __n->_M_next();
+	  this->_M_deallocate_node(__n);
+	  __n = __p;
+	  ++__result;
+	  --_M_element_count;
+	}
+      while (__n != __n_last);
+
+      if (__prev_n == _M_buckets[__bkt])
+	_M_remove_bucket_begin(__bkt, __n_last, __n_last_bkt);
+      else if (__n_last && __n_last_bkt != __bkt)
+	_M_buckets[__n_last_bkt] = __prev_n;
+      __prev_n->_M_nxt = __n_last;
+      return __result;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    auto
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    erase(const_iterator __first, const_iterator __last)
+    -> iterator
+    {
+      __node_type* __n = __first._M_cur;
+      __node_type* __last_n = __last._M_cur;
+      if (__n == __last_n)
+	return iterator(__n);
+
+      std::size_t __bkt = _M_bucket_index(__n);
+
+      __node_base* __prev_n = _M_get_previous_node(__bkt, __n);
+      bool __is_bucket_begin = __n == _M_bucket_begin(__bkt);
+      std::size_t __n_bkt = __bkt;
+      for (;;)
+	{
+	  do
+	    {
+	      __node_type* __tmp = __n;
+	      __n = __n->_M_next();
+	      this->_M_deallocate_node(__tmp);
+	      --_M_element_count;
+	      if (!__n)
+		break;
+	      __n_bkt = _M_bucket_index(__n);
+	    }
+	  while (__n != __last_n && __n_bkt == __bkt);
+	  if (__is_bucket_begin)
+	    _M_remove_bucket_begin(__bkt, __n, __n_bkt);
+	  if (__n == __last_n)
+	    break;
+	  __is_bucket_begin = true;
+	  __bkt = __n_bkt;
+	}
+
+      if (__n && (__n_bkt != __bkt || __is_bucket_begin))
+	_M_buckets[__n_bkt] = __prev_n;
+      __prev_n->_M_nxt = __n;
+      return iterator(__n);
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    clear() noexcept
+    {
+      this->_M_deallocate_nodes(_M_begin());
+      __builtin_memset(_M_buckets, 0, _M_bucket_count * sizeof(__bucket_type));
+      _M_element_count = 0;
+      _M_before_begin._M_nxt = nullptr;
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    rehash(size_type __n)
+    {
+      const __rehash_state& __saved_state = _M_rehash_policy._M_state();
+      std::size_t __buckets
+	= std::max(_M_rehash_policy._M_bkt_for_elements(_M_element_count + 1),
+		   __n);
+      __buckets = _M_rehash_policy._M_next_bkt(__buckets);
+
+      if (__buckets != _M_bucket_count)
+	_M_rehash(__buckets, __saved_state);
+      else
+	// No rehash, restore previous state to keep a consistent state.
+	_M_rehash_policy._M_reset(__saved_state);
+    }
+
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_rehash(size_type __n, const __rehash_state& __state)
+    {
+      __try
+	{
+	  _M_rehash_aux(__n, __unique_keys());
+	}
+      __catch(...)
+	{
+	  // A failure here means that buckets allocation failed.  We only
+	  // have to restore hash policy previous state.
+	  _M_rehash_policy._M_reset(__state);
+	  __throw_exception_again;
+	}
+    }
+
+  // Rehash when there is no equivalent elements.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_rehash_aux(size_type __n, std::true_type)
+    {
+      __bucket_type* __new_buckets = _M_allocate_buckets(__n);
+      __node_type* __p = _M_begin();
+      _M_before_begin._M_nxt = nullptr;
+      std::size_t __bbegin_bkt = 0;
+      while (__p)
+	{
+	  __node_type* __next = __p->_M_next();
+	  std::size_t __bkt = __hash_code_base::_M_bucket_index(__p, __n);
+	  if (!__new_buckets[__bkt])
+	    {
+	      __p->_M_nxt = _M_before_begin._M_nxt;
+	      _M_before_begin._M_nxt = __p;
+	      __new_buckets[__bkt] = &_M_before_begin;
+	      if (__p->_M_nxt)
+		__new_buckets[__bbegin_bkt] = __p;
+	      __bbegin_bkt = __bkt;
+	    }
+	  else
+	    {
+	      __p->_M_nxt = __new_buckets[__bkt]->_M_nxt;
+	      __new_buckets[__bkt]->_M_nxt = __p;
+	    }
+	  __p = __next;
+	}
+
+      _M_deallocate_buckets();
+      _M_bucket_count = __n;
+      _M_buckets = __new_buckets;
+    }
+
+  // Rehash when there can be equivalent elements, preserve their relative
+  // order.
+  template<typename _Key, typename _Value,
+	   typename _Alloc, typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+	   typename _Traits>
+    void
+    _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	       _H1, _H2, _Hash, _RehashPolicy, _Traits>::
+    _M_rehash_aux(size_type __n, std::false_type)
+    {
+      __bucket_type* __new_buckets = _M_allocate_buckets(__n);
+
+      __node_type* __p = _M_begin();
+      _M_before_begin._M_nxt = nullptr;
+      std::size_t __bbegin_bkt = 0;
+      std::size_t __prev_bkt = 0;
+      __node_type* __prev_p = nullptr;
+      bool __check_bucket = false;
+
+      while (__p)
+	{
+	  __node_type* __next = __p->_M_next();
+	  std::size_t __bkt = __hash_code_base::_M_bucket_index(__p, __n);
+
+	  if (__prev_p && __prev_bkt == __bkt)
+	    {
+	      // Previous insert was already in this bucket, we insert after
+	      // the previously inserted one to preserve equivalent elements
+	      // relative order.
+	      __p->_M_nxt = __prev_p->_M_nxt;
+	      __prev_p->_M_nxt = __p;
+
+	      // Inserting after a node in a bucket require to check that we
+	      // haven't change the bucket last node, in this case next
+	      // bucket containing its before begin node must be updated. We
+	      // schedule a check as soon as we move out of the sequence of
+	      // equivalent nodes to limit the number of checks.
+	      __check_bucket = true;
+	    }
+	  else
+	    {
+	      if (__check_bucket)
+		{
+		  // Check if we shall update the next bucket because of
+		  // insertions into __prev_bkt bucket.
+		  if (__prev_p->_M_nxt)
+		    {
+		      std::size_t __next_bkt
+			= __hash_code_base::_M_bucket_index(__prev_p->_M_next(),
+							    __n);
+		      if (__next_bkt != __prev_bkt)
+			__new_buckets[__next_bkt] = __prev_p;
+		    }
+		  __check_bucket = false;
+		}
+
+	      if (!__new_buckets[__bkt])
+		{
+		  __p->_M_nxt = _M_before_begin._M_nxt;
+		  _M_before_begin._M_nxt = __p;
+		  __new_buckets[__bkt] = &_M_before_begin;
+		  if (__p->_M_nxt)
+		    __new_buckets[__bbegin_bkt] = __p;
+		  __bbegin_bkt = __bkt;
+		}
+	      else
+		{
+		  __p->_M_nxt = __new_buckets[__bkt]->_M_nxt;
+		  __new_buckets[__bkt]->_M_nxt = __p;
+		}
+	    }
+	  __prev_p = __p;
+	  __prev_bkt = __bkt;
+	  __p = __next;
+	}
+
+      if (__check_bucket && __prev_p->_M_nxt)
+	{
+	  std::size_t __next_bkt
+	    = __hash_code_base::_M_bucket_index(__prev_p->_M_next(), __n);
+	  if (__next_bkt != __prev_bkt)
+	    __new_buckets[__next_bkt] = __prev_p;
+	}
+
+      _M_deallocate_buckets();
+      _M_bucket_count = __n;
+      _M_buckets = __new_buckets;
+    }
+
+#if __cplusplus > 201402L
+  template<typename, typename, typename> class _Hash_merge_helper { };
+#endif // C++17
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif // _HASHTABLE_H

+ 2129 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/hashtable_policy.h

@@ -0,0 +1,2129 @@
+// Internal policy header for unordered_set and unordered_map -*- C++ -*-
+
+// Copyright (C) 2010-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/hashtable_policy.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly.
+ *  @headername{unordered_map,unordered_set}
+ */
+
+#ifndef _HASHTABLE_POLICY_H
+#define _HASHTABLE_POLICY_H 1
+
+#include <bits/stl_algobase.h> // for std::min.
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    class _Hashtable;
+
+_GLIBCXX_END_NAMESPACE_VERSION
+
+namespace __detail
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @defgroup hashtable-detail Base and Implementation Classes
+   *  @ingroup unordered_associative_containers
+   *  @{
+   */
+  template<typename _Key, typename _Value,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _Traits>
+    struct _Hashtable_base;
+
+  // Helper function: return distance(first, last) for forward
+  // iterators, or 0 for input iterators.
+  template<class _Iterator>
+    inline typename std::iterator_traits<_Iterator>::difference_type
+    __distance_fw(_Iterator __first, _Iterator __last,
+		  std::input_iterator_tag)
+    { return 0; }
+
+  template<class _Iterator>
+    inline typename std::iterator_traits<_Iterator>::difference_type
+    __distance_fw(_Iterator __first, _Iterator __last,
+		  std::forward_iterator_tag)
+    { return std::distance(__first, __last); }
+
+  template<class _Iterator>
+    inline typename std::iterator_traits<_Iterator>::difference_type
+    __distance_fw(_Iterator __first, _Iterator __last)
+    {
+      typedef typename std::iterator_traits<_Iterator>::iterator_category _Tag;
+      return __distance_fw(__first, __last, _Tag());
+    }
+
+  // Helper type used to detect whether the hash functor is noexcept.
+  template <typename _Key, typename _Hash>
+    struct __is_noexcept_hash : std::__bool_constant<
+	noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
+    { };
+
+  struct _Identity
+  {
+    template<typename _Tp>
+      _Tp&&
+      operator()(_Tp&& __x) const
+      { return std::forward<_Tp>(__x); }
+  };
+
+  struct _Select1st
+  {
+    template<typename _Tp>
+      auto
+      operator()(_Tp&& __x) const
+      -> decltype(std::get<0>(std::forward<_Tp>(__x)))
+      { return std::get<0>(std::forward<_Tp>(__x)); }
+  };
+
+  template<typename _NodeAlloc>
+    struct _Hashtable_alloc;
+
+  // Functor recycling a pool of nodes and using allocation once the pool is
+  // empty.
+  template<typename _NodeAlloc>
+    struct _ReuseOrAllocNode
+    {
+    private:
+      using __node_alloc_type = _NodeAlloc;
+      using __hashtable_alloc = _Hashtable_alloc<__node_alloc_type>;
+      using __value_alloc_type = typename __hashtable_alloc::__value_alloc_type;
+      using __value_alloc_traits =
+	typename __hashtable_alloc::__value_alloc_traits;
+      using __node_alloc_traits =
+	typename __hashtable_alloc::__node_alloc_traits;
+      using __node_type = typename __hashtable_alloc::__node_type;
+
+    public:
+      _ReuseOrAllocNode(__node_type* __nodes, __hashtable_alloc& __h)
+	: _M_nodes(__nodes), _M_h(__h) { }
+      _ReuseOrAllocNode(const _ReuseOrAllocNode&) = delete;
+
+      ~_ReuseOrAllocNode()
+      { _M_h._M_deallocate_nodes(_M_nodes); }
+
+      template<typename _Arg>
+	__node_type*
+	operator()(_Arg&& __arg) const
+	{
+	  if (_M_nodes)
+	    {
+	      __node_type* __node = _M_nodes;
+	      _M_nodes = _M_nodes->_M_next();
+	      __node->_M_nxt = nullptr;
+	      __value_alloc_type __a(_M_h._M_node_allocator());
+	      __value_alloc_traits::destroy(__a, __node->_M_valptr());
+	      __try
+		{
+		  __value_alloc_traits::construct(__a, __node->_M_valptr(),
+						  std::forward<_Arg>(__arg));
+		}
+	      __catch(...)
+		{
+		  __node->~__node_type();
+		  __node_alloc_traits::deallocate(_M_h._M_node_allocator(),
+						  __node, 1);
+		  __throw_exception_again;
+		}
+	      return __node;
+	    }
+	  return _M_h._M_allocate_node(std::forward<_Arg>(__arg));
+	}
+
+    private:
+      mutable __node_type* _M_nodes;
+      __hashtable_alloc& _M_h;
+    };
+
+  // Functor similar to the previous one but without any pool of nodes to
+  // recycle.
+  template<typename _NodeAlloc>
+    struct _AllocNode
+    {
+    private:
+      using __hashtable_alloc = _Hashtable_alloc<_NodeAlloc>;
+      using __node_type = typename __hashtable_alloc::__node_type;
+
+    public:
+      _AllocNode(__hashtable_alloc& __h)
+	: _M_h(__h) { }
+
+      template<typename _Arg>
+	__node_type*
+	operator()(_Arg&& __arg) const
+	{ return _M_h._M_allocate_node(std::forward<_Arg>(__arg)); }
+
+    private:
+      __hashtable_alloc& _M_h;
+    };
+
+  // Auxiliary types used for all instantiations of _Hashtable nodes
+  // and iterators.
+
+  /**
+   *  struct _Hashtable_traits
+   *
+   *  Important traits for hash tables.
+   *
+   *  @tparam _Cache_hash_code  Boolean value. True if the value of
+   *  the hash function is stored along with the value. This is a
+   *  time-space tradeoff.  Storing it may improve lookup speed by
+   *  reducing the number of times we need to call the _Equal
+   *  function.
+   *
+   *  @tparam _Constant_iterators  Boolean value. True if iterator and
+   *  const_iterator are both constant iterator types. This is true
+   *  for unordered_set and unordered_multiset, false for
+   *  unordered_map and unordered_multimap.
+   *
+   *  @tparam _Unique_keys  Boolean value. True if the return value
+   *  of _Hashtable::count(k) is always at most one, false if it may
+   *  be an arbitrary number. This is true for unordered_set and
+   *  unordered_map, false for unordered_multiset and
+   *  unordered_multimap.
+   */
+  template<bool _Cache_hash_code, bool _Constant_iterators, bool _Unique_keys>
+    struct _Hashtable_traits
+    {
+      using __hash_cached = __bool_constant<_Cache_hash_code>;
+      using __constant_iterators = __bool_constant<_Constant_iterators>;
+      using __unique_keys = __bool_constant<_Unique_keys>;
+    };
+
+  /**
+   *  struct _Hash_node_base
+   *
+   *  Nodes, used to wrap elements stored in the hash table.  A policy
+   *  template parameter of class template _Hashtable controls whether
+   *  nodes also store a hash code. In some cases (e.g. strings) this
+   *  may be a performance win.
+   */
+  struct _Hash_node_base
+  {
+    _Hash_node_base* _M_nxt;
+
+    _Hash_node_base() noexcept : _M_nxt() { }
+
+    _Hash_node_base(_Hash_node_base* __next) noexcept : _M_nxt(__next) { }
+  };
+
+  /**
+   *  struct _Hash_node_value_base
+   *
+   *  Node type with the value to store.
+   */
+  template<typename _Value>
+    struct _Hash_node_value_base : _Hash_node_base
+    {
+      typedef _Value value_type;
+
+      __gnu_cxx::__aligned_buffer<_Value> _M_storage;
+
+      _Value*
+      _M_valptr() noexcept
+      { return _M_storage._M_ptr(); }
+
+      const _Value*
+      _M_valptr() const noexcept
+      { return _M_storage._M_ptr(); }
+
+      _Value&
+      _M_v() noexcept
+      { return *_M_valptr(); }
+
+      const _Value&
+      _M_v() const noexcept
+      { return *_M_valptr(); }
+    };
+
+  /**
+   *  Primary template struct _Hash_node.
+   */
+  template<typename _Value, bool _Cache_hash_code>
+    struct _Hash_node;
+
+  /**
+   *  Specialization for nodes with caches, struct _Hash_node.
+   *
+   *  Base class is __detail::_Hash_node_value_base.
+   */
+  template<typename _Value>
+    struct _Hash_node<_Value, true> : _Hash_node_value_base<_Value>
+    {
+      std::size_t  _M_hash_code;
+
+      _Hash_node*
+      _M_next() const noexcept
+      { return static_cast<_Hash_node*>(this->_M_nxt); }
+    };
+
+  /**
+   *  Specialization for nodes without caches, struct _Hash_node.
+   *
+   *  Base class is __detail::_Hash_node_value_base.
+   */
+  template<typename _Value>
+    struct _Hash_node<_Value, false> : _Hash_node_value_base<_Value>
+    {
+      _Hash_node*
+      _M_next() const noexcept
+      { return static_cast<_Hash_node*>(this->_M_nxt); }
+    };
+
+  /// Base class for node iterators.
+  template<typename _Value, bool _Cache_hash_code>
+    struct _Node_iterator_base
+    {
+      using __node_type = _Hash_node<_Value, _Cache_hash_code>;
+
+      __node_type*  _M_cur;
+
+      _Node_iterator_base(__node_type* __p) noexcept
+      : _M_cur(__p) { }
+
+      void
+      _M_incr() noexcept
+      { _M_cur = _M_cur->_M_next(); }
+    };
+
+  template<typename _Value, bool _Cache_hash_code>
+    inline bool
+    operator==(const _Node_iterator_base<_Value, _Cache_hash_code>& __x,
+	       const _Node_iterator_base<_Value, _Cache_hash_code >& __y)
+    noexcept
+    { return __x._M_cur == __y._M_cur; }
+
+  template<typename _Value, bool _Cache_hash_code>
+    inline bool
+    operator!=(const _Node_iterator_base<_Value, _Cache_hash_code>& __x,
+	       const _Node_iterator_base<_Value, _Cache_hash_code>& __y)
+    noexcept
+    { return __x._M_cur != __y._M_cur; }
+
+  /// Node iterators, used to iterate through all the hashtable.
+  template<typename _Value, bool __constant_iterators, bool __cache>
+    struct _Node_iterator
+    : public _Node_iterator_base<_Value, __cache>
+    {
+    private:
+      using __base_type = _Node_iterator_base<_Value, __cache>;
+      using __node_type = typename __base_type::__node_type;
+
+    public:
+      typedef _Value					value_type;
+      typedef std::ptrdiff_t				difference_type;
+      typedef std::forward_iterator_tag			iterator_category;
+
+      using pointer = typename std::conditional<__constant_iterators,
+						const _Value*, _Value*>::type;
+
+      using reference = typename std::conditional<__constant_iterators,
+						  const _Value&, _Value&>::type;
+
+      _Node_iterator() noexcept
+      : __base_type(0) { }
+
+      explicit
+      _Node_iterator(__node_type* __p) noexcept
+      : __base_type(__p) { }
+
+      reference
+      operator*() const noexcept
+      { return this->_M_cur->_M_v(); }
+
+      pointer
+      operator->() const noexcept
+      { return this->_M_cur->_M_valptr(); }
+
+      _Node_iterator&
+      operator++() noexcept
+      {
+	this->_M_incr();
+	return *this;
+      }
+
+      _Node_iterator
+      operator++(int) noexcept
+      {
+	_Node_iterator __tmp(*this);
+	this->_M_incr();
+	return __tmp;
+      }
+    };
+
+  /// Node const_iterators, used to iterate through all the hashtable.
+  template<typename _Value, bool __constant_iterators, bool __cache>
+    struct _Node_const_iterator
+    : public _Node_iterator_base<_Value, __cache>
+    {
+    private:
+      using __base_type = _Node_iterator_base<_Value, __cache>;
+      using __node_type = typename __base_type::__node_type;
+
+    public:
+      typedef _Value					value_type;
+      typedef std::ptrdiff_t				difference_type;
+      typedef std::forward_iterator_tag			iterator_category;
+
+      typedef const _Value*				pointer;
+      typedef const _Value&				reference;
+
+      _Node_const_iterator() noexcept
+      : __base_type(0) { }
+
+      explicit
+      _Node_const_iterator(__node_type* __p) noexcept
+      : __base_type(__p) { }
+
+      _Node_const_iterator(const _Node_iterator<_Value, __constant_iterators,
+			   __cache>& __x) noexcept
+      : __base_type(__x._M_cur) { }
+
+      reference
+      operator*() const noexcept
+      { return this->_M_cur->_M_v(); }
+
+      pointer
+      operator->() const noexcept
+      { return this->_M_cur->_M_valptr(); }
+
+      _Node_const_iterator&
+      operator++() noexcept
+      {
+	this->_M_incr();
+	return *this;
+      }
+
+      _Node_const_iterator
+      operator++(int) noexcept
+      {
+	_Node_const_iterator __tmp(*this);
+	this->_M_incr();
+	return __tmp;
+      }
+    };
+
+  // Many of class template _Hashtable's template parameters are policy
+  // classes.  These are defaults for the policies.
+
+  /// Default range hashing function: use division to fold a large number
+  /// into the range [0, N).
+  struct _Mod_range_hashing
+  {
+    typedef std::size_t first_argument_type;
+    typedef std::size_t second_argument_type;
+    typedef std::size_t result_type;
+
+    result_type
+    operator()(first_argument_type __num,
+	       second_argument_type __den) const noexcept
+    { return __num % __den; }
+  };
+
+  /// Default ranged hash function H.  In principle it should be a
+  /// function object composed from objects of type H1 and H2 such that
+  /// h(k, N) = h2(h1(k), N), but that would mean making extra copies of
+  /// h1 and h2.  So instead we'll just use a tag to tell class template
+  /// hashtable to do that composition.
+  struct _Default_ranged_hash { };
+
+  /// Default value for rehash policy.  Bucket size is (usually) the
+  /// smallest prime that keeps the load factor small enough.
+  struct _Prime_rehash_policy
+  {
+    using __has_load_factor = std::true_type;
+
+    _Prime_rehash_policy(float __z = 1.0) noexcept
+    : _M_max_load_factor(__z), _M_next_resize(0) { }
+
+    float
+    max_load_factor() const noexcept
+    { return _M_max_load_factor; }
+
+    // Return a bucket size no smaller than n.
+    std::size_t
+    _M_next_bkt(std::size_t __n) const;
+
+    // Return a bucket count appropriate for n elements
+    std::size_t
+    _M_bkt_for_elements(std::size_t __n) const
+    { return __builtin_ceil(__n / (long double)_M_max_load_factor); }
+
+    // __n_bkt is current bucket count, __n_elt is current element count,
+    // and __n_ins is number of elements to be inserted.  Do we need to
+    // increase bucket count?  If so, return make_pair(true, n), where n
+    // is the new bucket count.  If not, return make_pair(false, 0).
+    std::pair<bool, std::size_t>
+    _M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
+		   std::size_t __n_ins) const;
+
+    typedef std::size_t _State;
+
+    _State
+    _M_state() const
+    { return _M_next_resize; }
+
+    void
+    _M_reset() noexcept
+    { _M_next_resize = 0; }
+
+    void
+    _M_reset(_State __state)
+    { _M_next_resize = __state; }
+
+    static const std::size_t _S_growth_factor = 2;
+
+    float		_M_max_load_factor;
+    mutable std::size_t	_M_next_resize;
+  };
+
+  /// Range hashing function assuming that second arg is a power of 2.
+  struct _Mask_range_hashing
+  {
+    typedef std::size_t first_argument_type;
+    typedef std::size_t second_argument_type;
+    typedef std::size_t result_type;
+
+    result_type
+    operator()(first_argument_type __num,
+	       second_argument_type __den) const noexcept
+    { return __num & (__den - 1); }
+  };
+
+  /// Compute closest power of 2.
+  _GLIBCXX14_CONSTEXPR
+  inline std::size_t
+  __clp2(std::size_t __n) noexcept
+  {
+#if __SIZEOF_SIZE_T__ >= 8
+    std::uint_fast64_t __x = __n;
+#else
+    std::uint_fast32_t __x = __n;
+#endif
+    // Algorithm from Hacker's Delight, Figure 3-3.
+    __x = __x - 1;
+    __x = __x | (__x >> 1);
+    __x = __x | (__x >> 2);
+    __x = __x | (__x >> 4);
+    __x = __x | (__x >> 8);
+    __x = __x | (__x >>16);
+#if __SIZEOF_SIZE_T__ >= 8
+    __x = __x | (__x >>32);
+#endif
+    return __x + 1;
+  }
+
+  /// Rehash policy providing power of 2 bucket numbers. Avoids modulo
+  /// operations.
+  struct _Power2_rehash_policy
+  {
+    using __has_load_factor = std::true_type;
+
+    _Power2_rehash_policy(float __z = 1.0) noexcept
+    : _M_max_load_factor(__z), _M_next_resize(0) { }
+
+    float
+    max_load_factor() const noexcept
+    { return _M_max_load_factor; }
+
+    // Return a bucket size no smaller than n (as long as n is not above the
+    // highest power of 2).
+    std::size_t
+    _M_next_bkt(std::size_t __n) noexcept
+    {
+      const auto __max_width = std::min<size_t>(sizeof(size_t), 8);
+      const auto __max_bkt = size_t(1) << (__max_width * __CHAR_BIT__ - 1);
+      std::size_t __res = __clp2(__n);
+
+      if (__res == __n)
+	__res <<= 1;
+
+      if (__res == 0)
+	__res = __max_bkt;
+
+      if (__res == __max_bkt)
+	// Set next resize to the max value so that we never try to rehash again
+	// as we already reach the biggest possible bucket number.
+	// Note that it might result in max_load_factor not being respected.
+	_M_next_resize = std::size_t(-1);
+      else
+	_M_next_resize
+	  = __builtin_ceil(__res * (long double)_M_max_load_factor);
+
+      return __res;
+    }
+
+    // Return a bucket count appropriate for n elements
+    std::size_t
+    _M_bkt_for_elements(std::size_t __n) const noexcept
+    { return __builtin_ceil(__n / (long double)_M_max_load_factor); }
+
+    // __n_bkt is current bucket count, __n_elt is current element count,
+    // and __n_ins is number of elements to be inserted.  Do we need to
+    // increase bucket count?  If so, return make_pair(true, n), where n
+    // is the new bucket count.  If not, return make_pair(false, 0).
+    std::pair<bool, std::size_t>
+    _M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
+		   std::size_t __n_ins) noexcept
+    {
+      if (__n_elt + __n_ins >= _M_next_resize)
+	{
+	  long double __min_bkts = (__n_elt + __n_ins)
+					/ (long double)_M_max_load_factor;
+	  if (__min_bkts >= __n_bkt)
+	    return std::make_pair(true,
+	      _M_next_bkt(std::max<std::size_t>(__builtin_floor(__min_bkts) + 1,
+						__n_bkt * _S_growth_factor)));
+
+	  _M_next_resize
+	    = __builtin_floor(__n_bkt * (long double)_M_max_load_factor);
+	  return std::make_pair(false, 0);
+	}
+      else
+	return std::make_pair(false, 0);
+    }
+
+    typedef std::size_t _State;
+
+    _State
+    _M_state() const noexcept
+    { return _M_next_resize; }
+
+    void
+    _M_reset() noexcept
+    { _M_next_resize = 0; }
+
+    void
+    _M_reset(_State __state) noexcept
+    { _M_next_resize = __state; }
+
+    static const std::size_t _S_growth_factor = 2;
+
+    float	_M_max_load_factor;
+    std::size_t	_M_next_resize;
+  };
+
+  // Base classes for std::_Hashtable.  We define these base classes
+  // because in some cases we want to do different things depending on
+  // the value of a policy class.  In some cases the policy class
+  // affects which member functions and nested typedefs are defined;
+  // we handle that by specializing base class templates.  Several of
+  // the base class templates need to access other members of class
+  // template _Hashtable, so we use a variant of the "Curiously
+  // Recurring Template Pattern" (CRTP) technique.
+
+  /**
+   *  Primary class template _Map_base.
+   *
+   *  If the hashtable has a value type of the form pair<T1, T2> and a
+   *  key extraction policy (_ExtractKey) that returns the first part
+   *  of the pair, the hashtable gets a mapped_type typedef.  If it
+   *  satisfies those criteria and also has unique keys, then it also
+   *  gets an operator[].
+   */
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits,
+	   bool _Unique_keys = _Traits::__unique_keys::value>
+    struct _Map_base { };
+
+  /// Partial specialization, __unique_keys set to false.
+  template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
+		     _H1, _H2, _Hash, _RehashPolicy, _Traits, false>
+    {
+      using mapped_type = typename std::tuple_element<1, _Pair>::type;
+    };
+
+  /// Partial specialization, __unique_keys set to true.
+  template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
+		     _H1, _H2, _Hash, _RehashPolicy, _Traits, true>
+    {
+    private:
+      using __hashtable_base = __detail::_Hashtable_base<_Key, _Pair,
+							 _Select1st,
+							_Equal, _H1, _H2, _Hash,
+							  _Traits>;
+
+      using __hashtable = _Hashtable<_Key, _Pair, _Alloc,
+				     _Select1st, _Equal,
+				     _H1, _H2, _Hash, _RehashPolicy, _Traits>;
+
+      using __hash_code = typename __hashtable_base::__hash_code;
+      using __node_type = typename __hashtable_base::__node_type;
+
+    public:
+      using key_type = typename __hashtable_base::key_type;
+      using iterator = typename __hashtable_base::iterator;
+      using mapped_type = typename std::tuple_element<1, _Pair>::type;
+
+      mapped_type&
+      operator[](const key_type& __k);
+
+      mapped_type&
+      operator[](key_type&& __k);
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // DR 761. unordered_map needs an at() member function.
+      mapped_type&
+      at(const key_type& __k);
+
+      const mapped_type&
+      at(const key_type& __k) const;
+    };
+
+  template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    auto
+    _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
+	      _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
+    operator[](const key_type& __k)
+    -> mapped_type&
+    {
+      __hashtable* __h = static_cast<__hashtable*>(this);
+      __hash_code __code = __h->_M_hash_code(__k);
+      std::size_t __n = __h->_M_bucket_index(__k, __code);
+      __node_type* __p = __h->_M_find_node(__n, __k, __code);
+
+      if (!__p)
+	{
+	  __p = __h->_M_allocate_node(std::piecewise_construct,
+				      std::tuple<const key_type&>(__k),
+				      std::tuple<>());
+	  return __h->_M_insert_unique_node(__n, __code, __p)->second;
+	}
+
+      return __p->_M_v().second;
+    }
+
+  template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    auto
+    _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
+	      _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
+    operator[](key_type&& __k)
+    -> mapped_type&
+    {
+      __hashtable* __h = static_cast<__hashtable*>(this);
+      __hash_code __code = __h->_M_hash_code(__k);
+      std::size_t __n = __h->_M_bucket_index(__k, __code);
+      __node_type* __p = __h->_M_find_node(__n, __k, __code);
+
+      if (!__p)
+	{
+	  __p = __h->_M_allocate_node(std::piecewise_construct,
+				      std::forward_as_tuple(std::move(__k)),
+				      std::tuple<>());
+	  return __h->_M_insert_unique_node(__n, __code, __p)->second;
+	}
+
+      return __p->_M_v().second;
+    }
+
+  template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    auto
+    _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
+	      _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
+    at(const key_type& __k)
+    -> mapped_type&
+    {
+      __hashtable* __h = static_cast<__hashtable*>(this);
+      __hash_code __code = __h->_M_hash_code(__k);
+      std::size_t __n = __h->_M_bucket_index(__k, __code);
+      __node_type* __p = __h->_M_find_node(__n, __k, __code);
+
+      if (!__p)
+	__throw_out_of_range(__N("_Map_base::at"));
+      return __p->_M_v().second;
+    }
+
+  template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    auto
+    _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
+	      _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
+    at(const key_type& __k) const
+    -> const mapped_type&
+    {
+      const __hashtable* __h = static_cast<const __hashtable*>(this);
+      __hash_code __code = __h->_M_hash_code(__k);
+      std::size_t __n = __h->_M_bucket_index(__k, __code);
+      __node_type* __p = __h->_M_find_node(__n, __k, __code);
+
+      if (!__p)
+	__throw_out_of_range(__N("_Map_base::at"));
+      return __p->_M_v().second;
+    }
+
+  /**
+   *  Primary class template _Insert_base.
+   *
+   *  Defines @c insert member functions appropriate to all _Hashtables.
+   */
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Insert_base
+    {
+    protected:
+      using __hashtable = _Hashtable<_Key, _Value, _Alloc, _ExtractKey,
+				     _Equal, _H1, _H2, _Hash,
+				     _RehashPolicy, _Traits>;
+
+      using __hashtable_base = _Hashtable_base<_Key, _Value, _ExtractKey,
+					       _Equal, _H1, _H2, _Hash,
+					       _Traits>;
+
+      using value_type = typename __hashtable_base::value_type;
+      using iterator = typename __hashtable_base::iterator;
+      using const_iterator =  typename __hashtable_base::const_iterator;
+      using size_type = typename __hashtable_base::size_type;
+
+      using __unique_keys = typename __hashtable_base::__unique_keys;
+      using __ireturn_type = typename __hashtable_base::__ireturn_type;
+      using __node_type = _Hash_node<_Value, _Traits::__hash_cached::value>;
+      using __node_alloc_type = __alloc_rebind<_Alloc, __node_type>;
+      using __node_gen_type = _AllocNode<__node_alloc_type>;
+
+      __hashtable&
+      _M_conjure_hashtable()
+      { return *(static_cast<__hashtable*>(this)); }
+
+      template<typename _InputIterator, typename _NodeGetter>
+	void
+	_M_insert_range(_InputIterator __first, _InputIterator __last,
+			const _NodeGetter&);
+
+    public:
+      __ireturn_type
+      insert(const value_type& __v)
+      {
+	__hashtable& __h = _M_conjure_hashtable();
+	__node_gen_type __node_gen(__h);
+	return __h._M_insert(__v, __node_gen, __unique_keys());
+      }
+
+      iterator
+      insert(const_iterator __hint, const value_type& __v)
+      {
+	__hashtable& __h = _M_conjure_hashtable();
+	__node_gen_type __node_gen(__h);	
+	return __h._M_insert(__hint, __v, __node_gen, __unique_keys());
+      }
+
+      void
+      insert(initializer_list<value_type> __l)
+      { this->insert(__l.begin(), __l.end()); }
+
+      template<typename _InputIterator>
+	void
+	insert(_InputIterator __first, _InputIterator __last)
+	{
+	  __hashtable& __h = _M_conjure_hashtable();
+	  __node_gen_type __node_gen(__h);
+	  return _M_insert_range(__first, __last, __node_gen);
+	}
+    };
+
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    template<typename _InputIterator, typename _NodeGetter>
+      void
+      _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash,
+		    _RehashPolicy, _Traits>::
+      _M_insert_range(_InputIterator __first, _InputIterator __last,
+		      const _NodeGetter& __node_gen)
+      {
+	using __rehash_type = typename __hashtable::__rehash_type;
+	using __rehash_state = typename __hashtable::__rehash_state;
+	using pair_type = std::pair<bool, std::size_t>;
+
+	size_type __n_elt = __detail::__distance_fw(__first, __last);
+
+	__hashtable& __h = _M_conjure_hashtable();
+	__rehash_type& __rehash = __h._M_rehash_policy;
+	const __rehash_state& __saved_state = __rehash._M_state();
+	pair_type __do_rehash = __rehash._M_need_rehash(__h._M_bucket_count,
+							__h._M_element_count,
+							__n_elt);
+
+	if (__do_rehash.first)
+	  __h._M_rehash(__do_rehash.second, __saved_state);
+
+	for (; __first != __last; ++__first)
+	  __h._M_insert(*__first, __node_gen, __unique_keys());
+      }
+
+  /**
+   *  Primary class template _Insert.
+   *
+   *  Defines @c insert member functions that depend on _Hashtable policies,
+   *  via partial specializations.
+   */
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits,
+	   bool _Constant_iterators = _Traits::__constant_iterators::value>
+    struct _Insert;
+
+  /// Specialization.
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash,
+		   _RehashPolicy, _Traits, true>
+    : public _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+			   _H1, _H2, _Hash, _RehashPolicy, _Traits>
+    {
+      using __base_type = _Insert_base<_Key, _Value, _Alloc, _ExtractKey,
+					_Equal, _H1, _H2, _Hash,
+					_RehashPolicy, _Traits>;
+
+      using __hashtable_base = _Hashtable_base<_Key, _Value, _ExtractKey,
+					       _Equal, _H1, _H2, _Hash,
+					       _Traits>;
+
+      using value_type = typename __base_type::value_type;
+      using iterator = typename __base_type::iterator;
+      using const_iterator =  typename __base_type::const_iterator;
+
+      using __unique_keys = typename __base_type::__unique_keys;
+      using __ireturn_type = typename __hashtable_base::__ireturn_type;
+      using __hashtable = typename __base_type::__hashtable;
+      using __node_gen_type = typename __base_type::__node_gen_type;
+
+      using __base_type::insert;
+
+      __ireturn_type
+      insert(value_type&& __v)
+      {
+	__hashtable& __h = this->_M_conjure_hashtable();
+	__node_gen_type __node_gen(__h);
+	return __h._M_insert(std::move(__v), __node_gen, __unique_keys());
+      }
+
+      iterator
+      insert(const_iterator __hint, value_type&& __v)
+      {
+	__hashtable& __h = this->_M_conjure_hashtable();
+	__node_gen_type __node_gen(__h);
+	return __h._M_insert(__hint, std::move(__v), __node_gen,
+			     __unique_keys());
+      }
+    };
+
+  /// Specialization.
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash,
+		   _RehashPolicy, _Traits, false>
+    : public _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+			   _H1, _H2, _Hash, _RehashPolicy, _Traits>
+    {
+      using __base_type = _Insert_base<_Key, _Value, _Alloc, _ExtractKey,
+				       _Equal, _H1, _H2, _Hash,
+				       _RehashPolicy, _Traits>;
+      using value_type = typename __base_type::value_type;
+      using iterator = typename __base_type::iterator;
+      using const_iterator =  typename __base_type::const_iterator;
+
+      using __unique_keys = typename __base_type::__unique_keys;
+      using __hashtable = typename __base_type::__hashtable;
+      using __ireturn_type = typename __base_type::__ireturn_type;
+
+      using __base_type::insert;
+
+      template<typename _Pair>
+	using __is_cons = std::is_constructible<value_type, _Pair&&>;
+
+      template<typename _Pair>
+	using _IFcons = std::enable_if<__is_cons<_Pair>::value>;
+
+      template<typename _Pair>
+	using _IFconsp = typename _IFcons<_Pair>::type;
+
+      template<typename _Pair, typename = _IFconsp<_Pair>>
+	__ireturn_type
+	insert(_Pair&& __v)
+	{
+	  __hashtable& __h = this->_M_conjure_hashtable();
+	  return __h._M_emplace(__unique_keys(), std::forward<_Pair>(__v));
+	}
+
+      template<typename _Pair, typename = _IFconsp<_Pair>>
+	iterator
+	insert(const_iterator __hint, _Pair&& __v)
+	{
+	  __hashtable& __h = this->_M_conjure_hashtable();
+	  return __h._M_emplace(__hint, __unique_keys(),
+				std::forward<_Pair>(__v));
+	}
+   };
+
+  template<typename _Policy>
+    using __has_load_factor = typename _Policy::__has_load_factor;
+
+  /**
+   *  Primary class template  _Rehash_base.
+   *
+   *  Give hashtable the max_load_factor functions and reserve iff the
+   *  rehash policy supports it.
+  */
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits,
+	   typename =
+	     __detected_or_t<std::false_type, __has_load_factor, _RehashPolicy>>
+    struct _Rehash_base;
+
+  /// Specialization when rehash policy doesn't provide load factor management.
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		      _H1, _H2, _Hash, _RehashPolicy, _Traits,
+		      std::false_type>
+    {
+    };
+
+  /// Specialization when rehash policy provide load factor management.
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+			_H1, _H2, _Hash, _RehashPolicy, _Traits,
+			std::true_type>
+    {
+      using __hashtable = _Hashtable<_Key, _Value, _Alloc, _ExtractKey,
+				     _Equal, _H1, _H2, _Hash,
+				     _RehashPolicy, _Traits>;
+
+      float
+      max_load_factor() const noexcept
+      {
+	const __hashtable* __this = static_cast<const __hashtable*>(this);
+	return __this->__rehash_policy().max_load_factor();
+      }
+
+      void
+      max_load_factor(float __z)
+      {
+	__hashtable* __this = static_cast<__hashtable*>(this);
+	__this->__rehash_policy(_RehashPolicy(__z));
+      }
+
+      void
+      reserve(std::size_t __n)
+      {
+	__hashtable* __this = static_cast<__hashtable*>(this);
+	__this->rehash(__builtin_ceil(__n / max_load_factor()));
+      }
+    };
+
+  /**
+   *  Primary class template _Hashtable_ebo_helper.
+   *
+   *  Helper class using EBO when it is not forbidden (the type is not
+   *  final) and when it is worth it (the type is empty.)
+   */
+  template<int _Nm, typename _Tp,
+	   bool __use_ebo = !__is_final(_Tp) && __is_empty(_Tp)>
+    struct _Hashtable_ebo_helper;
+
+  /// Specialization using EBO.
+  template<int _Nm, typename _Tp>
+    struct _Hashtable_ebo_helper<_Nm, _Tp, true>
+    : private _Tp
+    {
+      _Hashtable_ebo_helper() = default;
+
+      template<typename _OtherTp>
+	_Hashtable_ebo_helper(_OtherTp&& __tp)
+	  : _Tp(std::forward<_OtherTp>(__tp))
+	{ }
+
+      static const _Tp&
+      _S_cget(const _Hashtable_ebo_helper& __eboh)
+      { return static_cast<const _Tp&>(__eboh); }
+
+      static _Tp&
+      _S_get(_Hashtable_ebo_helper& __eboh)
+      { return static_cast<_Tp&>(__eboh); }
+    };
+
+  /// Specialization not using EBO.
+  template<int _Nm, typename _Tp>
+    struct _Hashtable_ebo_helper<_Nm, _Tp, false>
+    {
+      _Hashtable_ebo_helper() = default;
+
+      template<typename _OtherTp>
+	_Hashtable_ebo_helper(_OtherTp&& __tp)
+	  : _M_tp(std::forward<_OtherTp>(__tp))
+	{ }
+
+      static const _Tp&
+      _S_cget(const _Hashtable_ebo_helper& __eboh)
+      { return __eboh._M_tp; }
+
+      static _Tp&
+      _S_get(_Hashtable_ebo_helper& __eboh)
+      { return __eboh._M_tp; }
+
+    private:
+      _Tp _M_tp;
+    };
+
+  /**
+   *  Primary class template _Local_iterator_base.
+   *
+   *  Base class for local iterators, used to iterate within a bucket
+   *  but not between buckets.
+   */
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash,
+	   bool __cache_hash_code>
+    struct _Local_iterator_base;
+
+  /**
+   *  Primary class template _Hash_code_base.
+   *
+   *  Encapsulates two policy issues that aren't quite orthogonal.
+   *   (1) the difference between using a ranged hash function and using
+   *       the combination of a hash function and a range-hashing function.
+   *       In the former case we don't have such things as hash codes, so
+   *       we have a dummy type as placeholder.
+   *   (2) Whether or not we cache hash codes.  Caching hash codes is
+   *       meaningless if we have a ranged hash function.
+   *
+   *  We also put the key extraction objects here, for convenience.
+   *  Each specialization derives from one or more of the template
+   *  parameters to benefit from Ebo. This is important as this type
+   *  is inherited in some cases by the _Local_iterator_base type used
+   *  to implement local_iterator and const_local_iterator. As with
+   *  any iterator type we prefer to make it as small as possible.
+   *
+   *  Primary template is unused except as a hook for specializations.
+   */
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash,
+	   bool __cache_hash_code>
+    struct _Hash_code_base;
+
+  /// Specialization: ranged hash function, no caching hash codes.  H1
+  /// and H2 are provided but ignored.  We define a dummy hash code type.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash>
+    struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, false>
+    : private _Hashtable_ebo_helper<0, _ExtractKey>,
+      private _Hashtable_ebo_helper<1, _Hash>
+    {
+    private:
+      using __ebo_extract_key = _Hashtable_ebo_helper<0, _ExtractKey>;
+      using __ebo_hash = _Hashtable_ebo_helper<1, _Hash>;
+
+    protected:
+      typedef void* 					__hash_code;
+      typedef _Hash_node<_Value, false>			__node_type;
+
+      // We need the default constructor for the local iterators and _Hashtable
+      // default constructor.
+      _Hash_code_base() = default;
+
+      _Hash_code_base(const _ExtractKey& __ex, const _H1&, const _H2&,
+		      const _Hash& __h)
+      : __ebo_extract_key(__ex), __ebo_hash(__h) { }
+
+      __hash_code
+      _M_hash_code(const _Key& __key) const
+      { return 0; }
+
+      std::size_t
+      _M_bucket_index(const _Key& __k, __hash_code, std::size_t __n) const
+      { return _M_ranged_hash()(__k, __n); }
+
+      std::size_t
+      _M_bucket_index(const __node_type* __p, std::size_t __n) const
+	noexcept( noexcept(declval<const _Hash&>()(declval<const _Key&>(),
+						   (std::size_t)0)) )
+      { return _M_ranged_hash()(_M_extract()(__p->_M_v()), __n); }
+
+      void
+      _M_store_code(__node_type*, __hash_code) const
+      { }
+
+      void
+      _M_copy_code(__node_type*, const __node_type*) const
+      { }
+
+      void
+      _M_swap(_Hash_code_base& __x)
+      {
+	std::swap(_M_extract(), __x._M_extract());
+	std::swap(_M_ranged_hash(), __x._M_ranged_hash());
+      }
+
+      const _ExtractKey&
+      _M_extract() const { return __ebo_extract_key::_S_cget(*this); }
+
+      _ExtractKey&
+      _M_extract() { return __ebo_extract_key::_S_get(*this); }
+
+      const _Hash&
+      _M_ranged_hash() const { return __ebo_hash::_S_cget(*this); }
+
+      _Hash&
+      _M_ranged_hash() { return __ebo_hash::_S_get(*this); }
+    };
+
+  // No specialization for ranged hash function while caching hash codes.
+  // That combination is meaningless, and trying to do it is an error.
+
+  /// Specialization: ranged hash function, cache hash codes.  This
+  /// combination is meaningless, so we provide only a declaration
+  /// and no definition.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash>
+    struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, true>;
+
+  /// Specialization: hash function and range-hashing function, no
+  /// caching of hash codes.
+  /// Provides typedef and accessor required by C++ 11.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2>
+    struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
+			   _Default_ranged_hash, false>
+    : private _Hashtable_ebo_helper<0, _ExtractKey>,
+      private _Hashtable_ebo_helper<1, _H1>,
+      private _Hashtable_ebo_helper<2, _H2>
+    {
+    private:
+      using __ebo_extract_key = _Hashtable_ebo_helper<0, _ExtractKey>;
+      using __ebo_h1 = _Hashtable_ebo_helper<1, _H1>;
+      using __ebo_h2 = _Hashtable_ebo_helper<2, _H2>;
+
+      // Gives the local iterator implementation access to _M_bucket_index().
+      friend struct _Local_iterator_base<_Key, _Value, _ExtractKey, _H1, _H2,
+					 _Default_ranged_hash, false>;
+
+    public:
+      typedef _H1 					hasher;
+
+      hasher
+      hash_function() const
+      { return _M_h1(); }
+
+    protected:
+      typedef std::size_t 				__hash_code;
+      typedef _Hash_node<_Value, false>			__node_type;
+
+      // We need the default constructor for the local iterators and _Hashtable
+      // default constructor.
+      _Hash_code_base() = default;
+
+      _Hash_code_base(const _ExtractKey& __ex,
+		      const _H1& __h1, const _H2& __h2,
+		      const _Default_ranged_hash&)
+      : __ebo_extract_key(__ex), __ebo_h1(__h1), __ebo_h2(__h2) { }
+
+      __hash_code
+      _M_hash_code(const _Key& __k) const
+      { return _M_h1()(__k); }
+
+      std::size_t
+      _M_bucket_index(const _Key&, __hash_code __c, std::size_t __n) const
+      { return _M_h2()(__c, __n); }
+
+      std::size_t
+      _M_bucket_index(const __node_type* __p, std::size_t __n) const
+	noexcept( noexcept(declval<const _H1&>()(declval<const _Key&>()))
+		  && noexcept(declval<const _H2&>()((__hash_code)0,
+						    (std::size_t)0)) )
+      { return _M_h2()(_M_h1()(_M_extract()(__p->_M_v())), __n); }
+
+      void
+      _M_store_code(__node_type*, __hash_code) const
+      { }
+
+      void
+      _M_copy_code(__node_type*, const __node_type*) const
+      { }
+
+      void
+      _M_swap(_Hash_code_base& __x)
+      {
+	std::swap(_M_extract(), __x._M_extract());
+	std::swap(_M_h1(), __x._M_h1());
+	std::swap(_M_h2(), __x._M_h2());
+      }
+
+      const _ExtractKey&
+      _M_extract() const { return __ebo_extract_key::_S_cget(*this); }
+
+      _ExtractKey&
+      _M_extract() { return __ebo_extract_key::_S_get(*this); }
+
+      const _H1&
+      _M_h1() const { return __ebo_h1::_S_cget(*this); }
+
+      _H1&
+      _M_h1() { return __ebo_h1::_S_get(*this); }
+
+      const _H2&
+      _M_h2() const { return __ebo_h2::_S_cget(*this); }
+
+      _H2&
+      _M_h2() { return __ebo_h2::_S_get(*this); }
+    };
+
+  /// Specialization: hash function and range-hashing function,
+  /// caching hash codes.  H is provided but ignored.  Provides
+  /// typedef and accessor required by C++ 11.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2>
+    struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
+			   _Default_ranged_hash, true>
+    : private _Hashtable_ebo_helper<0, _ExtractKey>,
+      private _Hashtable_ebo_helper<1, _H1>,
+      private _Hashtable_ebo_helper<2, _H2>
+    {
+    private:
+      // Gives the local iterator implementation access to _M_h2().
+      friend struct _Local_iterator_base<_Key, _Value, _ExtractKey, _H1, _H2,
+					 _Default_ranged_hash, true>;
+
+      using __ebo_extract_key = _Hashtable_ebo_helper<0, _ExtractKey>;
+      using __ebo_h1 = _Hashtable_ebo_helper<1, _H1>;
+      using __ebo_h2 = _Hashtable_ebo_helper<2, _H2>;
+
+    public:
+      typedef _H1 					hasher;
+
+      hasher
+      hash_function() const
+      { return _M_h1(); }
+
+    protected:
+      typedef std::size_t 				__hash_code;
+      typedef _Hash_node<_Value, true>			__node_type;
+
+      // We need the default constructor for _Hashtable default constructor.
+      _Hash_code_base() = default;
+      _Hash_code_base(const _ExtractKey& __ex,
+		      const _H1& __h1, const _H2& __h2,
+		      const _Default_ranged_hash&)
+      : __ebo_extract_key(__ex), __ebo_h1(__h1), __ebo_h2(__h2) { }
+
+      __hash_code
+      _M_hash_code(const _Key& __k) const
+      { return _M_h1()(__k); }
+
+      std::size_t
+      _M_bucket_index(const _Key&, __hash_code __c,
+		      std::size_t __n) const
+      { return _M_h2()(__c, __n); }
+
+      std::size_t
+      _M_bucket_index(const __node_type* __p, std::size_t __n) const
+	noexcept( noexcept(declval<const _H2&>()((__hash_code)0,
+						 (std::size_t)0)) )
+      { return _M_h2()(__p->_M_hash_code, __n); }
+
+      void
+      _M_store_code(__node_type* __n, __hash_code __c) const
+      { __n->_M_hash_code = __c; }
+
+      void
+      _M_copy_code(__node_type* __to, const __node_type* __from) const
+      { __to->_M_hash_code = __from->_M_hash_code; }
+
+      void
+      _M_swap(_Hash_code_base& __x)
+      {
+	std::swap(_M_extract(), __x._M_extract());
+	std::swap(_M_h1(), __x._M_h1());
+	std::swap(_M_h2(), __x._M_h2());
+      }
+
+      const _ExtractKey&
+      _M_extract() const { return __ebo_extract_key::_S_cget(*this); }
+
+      _ExtractKey&
+      _M_extract() { return __ebo_extract_key::_S_get(*this); }
+
+      const _H1&
+      _M_h1() const { return __ebo_h1::_S_cget(*this); }
+
+      _H1&
+      _M_h1() { return __ebo_h1::_S_get(*this); }
+
+      const _H2&
+      _M_h2() const { return __ebo_h2::_S_cget(*this); }
+
+      _H2&
+      _M_h2() { return __ebo_h2::_S_get(*this); }
+    };
+
+  /**
+   *  Primary class template _Equal_helper.
+   *
+   */
+  template <typename _Key, typename _Value, typename _ExtractKey,
+	    typename _Equal, typename _HashCodeType,
+	    bool __cache_hash_code>
+  struct _Equal_helper;
+
+  /// Specialization.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _Equal, typename _HashCodeType>
+  struct _Equal_helper<_Key, _Value, _ExtractKey, _Equal, _HashCodeType, true>
+  {
+    static bool
+    _S_equals(const _Equal& __eq, const _ExtractKey& __extract,
+	      const _Key& __k, _HashCodeType __c, _Hash_node<_Value, true>* __n)
+    { return __c == __n->_M_hash_code && __eq(__k, __extract(__n->_M_v())); }
+  };
+
+  /// Specialization.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _Equal, typename _HashCodeType>
+  struct _Equal_helper<_Key, _Value, _ExtractKey, _Equal, _HashCodeType, false>
+  {
+    static bool
+    _S_equals(const _Equal& __eq, const _ExtractKey& __extract,
+	      const _Key& __k, _HashCodeType, _Hash_node<_Value, false>* __n)
+    { return __eq(__k, __extract(__n->_M_v())); }
+  };
+
+
+  /// Partial specialization used when nodes contain a cached hash code.
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash>
+    struct _Local_iterator_base<_Key, _Value, _ExtractKey,
+				_H1, _H2, _Hash, true>
+    : private _Hashtable_ebo_helper<0, _H2>
+    {
+    protected:
+      using __base_type = _Hashtable_ebo_helper<0, _H2>;
+      using __hash_code_base = _Hash_code_base<_Key, _Value, _ExtractKey,
+					       _H1, _H2, _Hash, true>;
+
+      _Local_iterator_base() = default;
+      _Local_iterator_base(const __hash_code_base& __base,
+			   _Hash_node<_Value, true>* __p,
+			   std::size_t __bkt, std::size_t __bkt_count)
+      : __base_type(__base._M_h2()),
+	_M_cur(__p), _M_bucket(__bkt), _M_bucket_count(__bkt_count) { }
+
+      void
+      _M_incr()
+      {
+	_M_cur = _M_cur->_M_next();
+	if (_M_cur)
+	  {
+	    std::size_t __bkt
+	      = __base_type::_S_get(*this)(_M_cur->_M_hash_code,
+					   _M_bucket_count);
+	    if (__bkt != _M_bucket)
+	      _M_cur = nullptr;
+	  }
+      }
+
+      _Hash_node<_Value, true>*  _M_cur;
+      std::size_t _M_bucket;
+      std::size_t _M_bucket_count;
+
+    public:
+      const void*
+      _M_curr() const { return _M_cur; }  // for equality ops
+
+      std::size_t
+      _M_get_bucket() const { return _M_bucket; }  // for debug mode
+    };
+
+  // Uninitialized storage for a _Hash_code_base.
+  // This type is DefaultConstructible and Assignable even if the
+  // _Hash_code_base type isn't, so that _Local_iterator_base<..., false>
+  // can be DefaultConstructible and Assignable.
+  template<typename _Tp, bool _IsEmpty = std::is_empty<_Tp>::value>
+    struct _Hash_code_storage
+    {
+      __gnu_cxx::__aligned_buffer<_Tp> _M_storage;
+
+      _Tp*
+      _M_h() { return _M_storage._M_ptr(); }
+
+      const _Tp*
+      _M_h() const { return _M_storage._M_ptr(); }
+    };
+
+  // Empty partial specialization for empty _Hash_code_base types.
+  template<typename _Tp>
+    struct _Hash_code_storage<_Tp, true>
+    {
+      static_assert( std::is_empty<_Tp>::value, "Type must be empty" );
+
+      // As _Tp is an empty type there will be no bytes written/read through
+      // the cast pointer, so no strict-aliasing violation.
+      _Tp*
+      _M_h() { return reinterpret_cast<_Tp*>(this); }
+
+      const _Tp*
+      _M_h() const { return reinterpret_cast<const _Tp*>(this); }
+    };
+
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash>
+    using __hash_code_for_local_iter
+      = _Hash_code_storage<_Hash_code_base<_Key, _Value, _ExtractKey,
+					   _H1, _H2, _Hash, false>>;
+
+  // Partial specialization used when hash codes are not cached
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash>
+    struct _Local_iterator_base<_Key, _Value, _ExtractKey,
+				_H1, _H2, _Hash, false>
+    : __hash_code_for_local_iter<_Key, _Value, _ExtractKey, _H1, _H2, _Hash>
+    {
+    protected:
+      using __hash_code_base = _Hash_code_base<_Key, _Value, _ExtractKey,
+					       _H1, _H2, _Hash, false>;
+
+      _Local_iterator_base() : _M_bucket_count(-1) { }
+
+      _Local_iterator_base(const __hash_code_base& __base,
+			   _Hash_node<_Value, false>* __p,
+			   std::size_t __bkt, std::size_t __bkt_count)
+      : _M_cur(__p), _M_bucket(__bkt), _M_bucket_count(__bkt_count)
+      { _M_init(__base); }
+
+      ~_Local_iterator_base()
+      {
+	if (_M_bucket_count != -1)
+	  _M_destroy();
+      }
+
+      _Local_iterator_base(const _Local_iterator_base& __iter)
+      : _M_cur(__iter._M_cur), _M_bucket(__iter._M_bucket),
+        _M_bucket_count(__iter._M_bucket_count)
+      {
+	if (_M_bucket_count != -1)
+	  _M_init(*__iter._M_h());
+      }
+
+      _Local_iterator_base&
+      operator=(const _Local_iterator_base& __iter)
+      {
+	if (_M_bucket_count != -1)
+	  _M_destroy();
+	_M_cur = __iter._M_cur;
+	_M_bucket = __iter._M_bucket;
+	_M_bucket_count = __iter._M_bucket_count;
+	if (_M_bucket_count != -1)
+	  _M_init(*__iter._M_h());
+	return *this;
+      }
+
+      void
+      _M_incr()
+      {
+	_M_cur = _M_cur->_M_next();
+	if (_M_cur)
+	  {
+	    std::size_t __bkt = this->_M_h()->_M_bucket_index(_M_cur,
+							      _M_bucket_count);
+	    if (__bkt != _M_bucket)
+	      _M_cur = nullptr;
+	  }
+      }
+
+      _Hash_node<_Value, false>*  _M_cur;
+      std::size_t _M_bucket;
+      std::size_t _M_bucket_count;
+
+      void
+      _M_init(const __hash_code_base& __base)
+      { ::new(this->_M_h()) __hash_code_base(__base); }
+
+      void
+      _M_destroy() { this->_M_h()->~__hash_code_base(); }
+
+    public:
+      const void*
+      _M_curr() const { return _M_cur; }  // for equality ops and debug mode
+
+      std::size_t
+      _M_get_bucket() const { return _M_bucket; }  // for debug mode
+    };
+
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash, bool __cache>
+    inline bool
+    operator==(const _Local_iterator_base<_Key, _Value, _ExtractKey,
+					  _H1, _H2, _Hash, __cache>& __x,
+	       const _Local_iterator_base<_Key, _Value, _ExtractKey,
+					  _H1, _H2, _Hash, __cache>& __y)
+    { return __x._M_curr() == __y._M_curr(); }
+
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash, bool __cache>
+    inline bool
+    operator!=(const _Local_iterator_base<_Key, _Value, _ExtractKey,
+					  _H1, _H2, _Hash, __cache>& __x,
+	       const _Local_iterator_base<_Key, _Value, _ExtractKey,
+					  _H1, _H2, _Hash, __cache>& __y)
+    { return __x._M_curr() != __y._M_curr(); }
+
+  /// local iterators
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash,
+	   bool __constant_iterators, bool __cache>
+    struct _Local_iterator
+    : public _Local_iterator_base<_Key, _Value, _ExtractKey,
+				  _H1, _H2, _Hash, __cache>
+    {
+    private:
+      using __base_type = _Local_iterator_base<_Key, _Value, _ExtractKey,
+					       _H1, _H2, _Hash, __cache>;
+      using __hash_code_base = typename __base_type::__hash_code_base;
+    public:
+      typedef _Value					value_type;
+      typedef typename std::conditional<__constant_iterators,
+					const _Value*, _Value*>::type
+						       pointer;
+      typedef typename std::conditional<__constant_iterators,
+					const _Value&, _Value&>::type
+						       reference;
+      typedef std::ptrdiff_t				difference_type;
+      typedef std::forward_iterator_tag			iterator_category;
+
+      _Local_iterator() = default;
+
+      _Local_iterator(const __hash_code_base& __base,
+		      _Hash_node<_Value, __cache>* __p,
+		      std::size_t __bkt, std::size_t __bkt_count)
+	: __base_type(__base, __p, __bkt, __bkt_count)
+      { }
+
+      reference
+      operator*() const
+      { return this->_M_cur->_M_v(); }
+
+      pointer
+      operator->() const
+      { return this->_M_cur->_M_valptr(); }
+
+      _Local_iterator&
+      operator++()
+      {
+	this->_M_incr();
+	return *this;
+      }
+
+      _Local_iterator
+      operator++(int)
+      {
+	_Local_iterator __tmp(*this);
+	this->_M_incr();
+	return __tmp;
+      }
+    };
+
+  /// local const_iterators
+  template<typename _Key, typename _Value, typename _ExtractKey,
+	   typename _H1, typename _H2, typename _Hash,
+	   bool __constant_iterators, bool __cache>
+    struct _Local_const_iterator
+    : public _Local_iterator_base<_Key, _Value, _ExtractKey,
+				  _H1, _H2, _Hash, __cache>
+    {
+    private:
+      using __base_type = _Local_iterator_base<_Key, _Value, _ExtractKey,
+					       _H1, _H2, _Hash, __cache>;
+      using __hash_code_base = typename __base_type::__hash_code_base;
+
+    public:
+      typedef _Value					value_type;
+      typedef const _Value*				pointer;
+      typedef const _Value&				reference;
+      typedef std::ptrdiff_t				difference_type;
+      typedef std::forward_iterator_tag			iterator_category;
+
+      _Local_const_iterator() = default;
+
+      _Local_const_iterator(const __hash_code_base& __base,
+			    _Hash_node<_Value, __cache>* __p,
+			    std::size_t __bkt, std::size_t __bkt_count)
+	: __base_type(__base, __p, __bkt, __bkt_count)
+      { }
+
+      _Local_const_iterator(const _Local_iterator<_Key, _Value, _ExtractKey,
+						  _H1, _H2, _Hash,
+						  __constant_iterators,
+						  __cache>& __x)
+	: __base_type(__x)
+      { }
+
+      reference
+      operator*() const
+      { return this->_M_cur->_M_v(); }
+
+      pointer
+      operator->() const
+      { return this->_M_cur->_M_valptr(); }
+
+      _Local_const_iterator&
+      operator++()
+      {
+	this->_M_incr();
+	return *this;
+      }
+
+      _Local_const_iterator
+      operator++(int)
+      {
+	_Local_const_iterator __tmp(*this);
+	this->_M_incr();
+	return __tmp;
+      }
+    };
+
+  /**
+   *  Primary class template _Hashtable_base.
+   *
+   *  Helper class adding management of _Equal functor to
+   *  _Hash_code_base type.
+   *
+   *  Base class templates are:
+   *    - __detail::_Hash_code_base
+   *    - __detail::_Hashtable_ebo_helper
+   */
+  template<typename _Key, typename _Value,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash, typename _Traits>
+  struct _Hashtable_base
+  : public _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash,
+			   _Traits::__hash_cached::value>,
+    private _Hashtable_ebo_helper<0, _Equal>
+  {
+  public:
+    typedef _Key					key_type;
+    typedef _Value					value_type;
+    typedef _Equal					key_equal;
+    typedef std::size_t					size_type;
+    typedef std::ptrdiff_t				difference_type;
+
+    using __traits_type = _Traits;
+    using __hash_cached = typename __traits_type::__hash_cached;
+    using __constant_iterators = typename __traits_type::__constant_iterators;
+    using __unique_keys = typename __traits_type::__unique_keys;
+
+    using __hash_code_base = _Hash_code_base<_Key, _Value, _ExtractKey,
+					     _H1, _H2, _Hash,
+					     __hash_cached::value>;
+
+    using __hash_code = typename __hash_code_base::__hash_code;
+    using __node_type = typename __hash_code_base::__node_type;
+
+    using iterator = __detail::_Node_iterator<value_type,
+					      __constant_iterators::value,
+					      __hash_cached::value>;
+
+    using const_iterator = __detail::_Node_const_iterator<value_type,
+						   __constant_iterators::value,
+						   __hash_cached::value>;
+
+    using local_iterator = __detail::_Local_iterator<key_type, value_type,
+						  _ExtractKey, _H1, _H2, _Hash,
+						  __constant_iterators::value,
+						     __hash_cached::value>;
+
+    using const_local_iterator = __detail::_Local_const_iterator<key_type,
+								 value_type,
+					_ExtractKey, _H1, _H2, _Hash,
+					__constant_iterators::value,
+					__hash_cached::value>;
+
+    using __ireturn_type = typename std::conditional<__unique_keys::value,
+						     std::pair<iterator, bool>,
+						     iterator>::type;
+  private:
+    using _EqualEBO = _Hashtable_ebo_helper<0, _Equal>;
+    using _EqualHelper =  _Equal_helper<_Key, _Value, _ExtractKey, _Equal,
+					__hash_code, __hash_cached::value>;
+
+  protected:
+    _Hashtable_base() = default;
+    _Hashtable_base(const _ExtractKey& __ex, const _H1& __h1, const _H2& __h2,
+		    const _Hash& __hash, const _Equal& __eq)
+    : __hash_code_base(__ex, __h1, __h2, __hash), _EqualEBO(__eq)
+    { }
+
+    bool
+    _M_equals(const _Key& __k, __hash_code __c, __node_type* __n) const
+    {
+      return _EqualHelper::_S_equals(_M_eq(), this->_M_extract(),
+				     __k, __c, __n);
+    }
+
+    void
+    _M_swap(_Hashtable_base& __x)
+    {
+      __hash_code_base::_M_swap(__x);
+      std::swap(_M_eq(), __x._M_eq());
+    }
+
+    const _Equal&
+    _M_eq() const { return _EqualEBO::_S_cget(*this); }
+
+    _Equal&
+    _M_eq() { return _EqualEBO::_S_get(*this); }
+  };
+
+  /**
+   *  struct _Equality_base.
+   *
+   *  Common types and functions for class _Equality.
+   */
+  struct _Equality_base
+  {
+  protected:
+    template<typename _Uiterator>
+      static bool
+      _S_is_permutation(_Uiterator, _Uiterator, _Uiterator);
+  };
+
+  // See std::is_permutation in N3068.
+  template<typename _Uiterator>
+    bool
+    _Equality_base::
+    _S_is_permutation(_Uiterator __first1, _Uiterator __last1,
+		      _Uiterator __first2)
+    {
+      for (; __first1 != __last1; ++__first1, ++__first2)
+	if (!(*__first1 == *__first2))
+	  break;
+
+      if (__first1 == __last1)
+	return true;
+
+      _Uiterator __last2 = __first2;
+      std::advance(__last2, std::distance(__first1, __last1));
+
+      for (_Uiterator __it1 = __first1; __it1 != __last1; ++__it1)
+	{
+	  _Uiterator __tmp =  __first1;
+	  while (__tmp != __it1 && !bool(*__tmp == *__it1))
+	    ++__tmp;
+
+	  // We've seen this one before.
+	  if (__tmp != __it1)
+	    continue;
+
+	  std::ptrdiff_t __n2 = 0;
+	  for (__tmp = __first2; __tmp != __last2; ++__tmp)
+	    if (*__tmp == *__it1)
+	      ++__n2;
+
+	  if (!__n2)
+	    return false;
+
+	  std::ptrdiff_t __n1 = 0;
+	  for (__tmp = __it1; __tmp != __last1; ++__tmp)
+	    if (*__tmp == *__it1)
+	      ++__n1;
+
+	  if (__n1 != __n2)
+	    return false;
+	}
+      return true;
+    }
+
+  /**
+   *  Primary class template  _Equality.
+   *
+   *  This is for implementing equality comparison for unordered
+   *  containers, per N3068, by John Lakos and Pablo Halpern.
+   *  Algorithmically, we follow closely the reference implementations
+   *  therein.
+   */
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits,
+	   bool _Unique_keys = _Traits::__unique_keys::value>
+    struct _Equality;
+
+  /// Specialization.
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Equality<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		     _H1, _H2, _Hash, _RehashPolicy, _Traits, true>
+    {
+      using __hashtable = _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+				     _H1, _H2, _Hash, _RehashPolicy, _Traits>;
+
+      bool
+      _M_equal(const __hashtable&) const;
+    };
+
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    bool
+    _Equality<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	      _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
+    _M_equal(const __hashtable& __other) const
+    {
+      const __hashtable* __this = static_cast<const __hashtable*>(this);
+
+      if (__this->size() != __other.size())
+	return false;
+
+      for (auto __itx = __this->begin(); __itx != __this->end(); ++__itx)
+	{
+	  const auto __ity = __other.find(_ExtractKey()(*__itx));
+	  if (__ity == __other.end() || !bool(*__ity == *__itx))
+	    return false;
+	}
+      return true;
+    }
+
+  /// Specialization.
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    struct _Equality<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+		     _H1, _H2, _Hash, _RehashPolicy, _Traits, false>
+    : public _Equality_base
+    {
+      using __hashtable = _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+				     _H1, _H2, _Hash, _RehashPolicy, _Traits>;
+
+      bool
+      _M_equal(const __hashtable&) const;
+    };
+
+  template<typename _Key, typename _Value, typename _Alloc,
+	   typename _ExtractKey, typename _Equal,
+	   typename _H1, typename _H2, typename _Hash,
+	   typename _RehashPolicy, typename _Traits>
+    bool
+    _Equality<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+	      _H1, _H2, _Hash, _RehashPolicy, _Traits, false>::
+    _M_equal(const __hashtable& __other) const
+    {
+      const __hashtable* __this = static_cast<const __hashtable*>(this);
+
+      if (__this->size() != __other.size())
+	return false;
+
+      for (auto __itx = __this->begin(); __itx != __this->end();)
+	{
+	  const auto __xrange = __this->equal_range(_ExtractKey()(*__itx));
+	  const auto __yrange = __other.equal_range(_ExtractKey()(*__itx));
+
+	  if (std::distance(__xrange.first, __xrange.second)
+	      != std::distance(__yrange.first, __yrange.second))
+	    return false;
+
+	  if (!_S_is_permutation(__xrange.first, __xrange.second,
+				 __yrange.first))
+	    return false;
+
+	  __itx = __xrange.second;
+	}
+      return true;
+    }
+
+  /**
+   * This type deals with all allocation and keeps an allocator instance through
+   * inheritance to benefit from EBO when possible.
+   */
+  template<typename _NodeAlloc>
+    struct _Hashtable_alloc : private _Hashtable_ebo_helper<0, _NodeAlloc>
+    {
+    private:
+      using __ebo_node_alloc = _Hashtable_ebo_helper<0, _NodeAlloc>;
+    public:
+      using __node_type = typename _NodeAlloc::value_type;
+      using __node_alloc_type = _NodeAlloc;
+      // Use __gnu_cxx to benefit from _S_always_equal and al.
+      using __node_alloc_traits = __gnu_cxx::__alloc_traits<__node_alloc_type>;
+
+      using __value_type = typename __node_type::value_type;
+      using __value_alloc_type =
+	__alloc_rebind<__node_alloc_type, __value_type>;
+      using __value_alloc_traits = std::allocator_traits<__value_alloc_type>;
+
+      using __node_base = __detail::_Hash_node_base;
+      using __bucket_type = __node_base*;      
+      using __bucket_alloc_type =
+	__alloc_rebind<__node_alloc_type, __bucket_type>;
+      using __bucket_alloc_traits = std::allocator_traits<__bucket_alloc_type>;
+
+      _Hashtable_alloc() = default;
+      _Hashtable_alloc(const _Hashtable_alloc&) = default;
+      _Hashtable_alloc(_Hashtable_alloc&&) = default;
+
+      template<typename _Alloc>
+	_Hashtable_alloc(_Alloc&& __a)
+	  : __ebo_node_alloc(std::forward<_Alloc>(__a))
+	{ }
+
+      __node_alloc_type&
+      _M_node_allocator()
+      { return __ebo_node_alloc::_S_get(*this); }
+
+      const __node_alloc_type&
+      _M_node_allocator() const
+      { return __ebo_node_alloc::_S_cget(*this); }
+
+      template<typename... _Args>
+	__node_type*
+	_M_allocate_node(_Args&&... __args);
+
+      void
+      _M_deallocate_node(__node_type* __n);
+
+      // Deallocate the linked list of nodes pointed to by __n
+      void
+      _M_deallocate_nodes(__node_type* __n);
+
+      __bucket_type*
+      _M_allocate_buckets(std::size_t __n);
+
+      void
+      _M_deallocate_buckets(__bucket_type*, std::size_t __n);
+    };
+
+  // Definitions of class template _Hashtable_alloc's out-of-line member
+  // functions.
+  template<typename _NodeAlloc>
+    template<typename... _Args>
+      typename _Hashtable_alloc<_NodeAlloc>::__node_type*
+      _Hashtable_alloc<_NodeAlloc>::_M_allocate_node(_Args&&... __args)
+      {
+	auto __nptr = __node_alloc_traits::allocate(_M_node_allocator(), 1);
+	__node_type* __n = std::__addressof(*__nptr);
+	__try
+	  {
+	    __value_alloc_type __a(_M_node_allocator());
+	    ::new ((void*)__n) __node_type;
+	    __value_alloc_traits::construct(__a, __n->_M_valptr(),
+					    std::forward<_Args>(__args)...);
+	    return __n;
+	  }
+	__catch(...)
+	  {
+	    __node_alloc_traits::deallocate(_M_node_allocator(), __nptr, 1);
+	    __throw_exception_again;
+	  }
+      }
+
+  template<typename _NodeAlloc>
+    void
+    _Hashtable_alloc<_NodeAlloc>::_M_deallocate_node(__node_type* __n)
+    {
+      typedef typename __node_alloc_traits::pointer _Ptr;
+      auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__n);
+      __value_alloc_type __a(_M_node_allocator());
+      __value_alloc_traits::destroy(__a, __n->_M_valptr());
+      __n->~__node_type();
+      __node_alloc_traits::deallocate(_M_node_allocator(), __ptr, 1);
+    }
+
+  template<typename _NodeAlloc>
+    void
+    _Hashtable_alloc<_NodeAlloc>::_M_deallocate_nodes(__node_type* __n)
+    {
+      while (__n)
+	{
+	  __node_type* __tmp = __n;
+	  __n = __n->_M_next();
+	  _M_deallocate_node(__tmp);
+	}
+    }
+
+  template<typename _NodeAlloc>
+    typename _Hashtable_alloc<_NodeAlloc>::__bucket_type*
+    _Hashtable_alloc<_NodeAlloc>::_M_allocate_buckets(std::size_t __n)
+    {
+      __bucket_alloc_type __alloc(_M_node_allocator());
+
+      auto __ptr = __bucket_alloc_traits::allocate(__alloc, __n);
+      __bucket_type* __p = std::__addressof(*__ptr);
+      __builtin_memset(__p, 0, __n * sizeof(__bucket_type));
+      return __p;
+    }
+
+  template<typename _NodeAlloc>
+    void
+    _Hashtable_alloc<_NodeAlloc>::_M_deallocate_buckets(__bucket_type* __bkts,
+							std::size_t __n)
+    {
+      typedef typename __bucket_alloc_traits::pointer _Ptr;
+      auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__bkts);
+      __bucket_alloc_type __alloc(_M_node_allocator());
+      __bucket_alloc_traits::deallocate(__alloc, __ptr, __n);
+    }
+
+ //@} hashtable-detail
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace __detail
+} // namespace std
+
+#endif // _HASHTABLE_POLICY_H

+ 212 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/indirect_array.h

@@ -0,0 +1,212 @@
+// The template and inlines for the -*- C++ -*- indirect_array class.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/indirect_array.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{valarray}
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _INDIRECT_ARRAY_H
+#define _INDIRECT_ARRAY_H 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @addtogroup numeric_arrays
+   * @{
+   */
+
+  /**
+   *  @brief  Reference to arbitrary subset of an array.
+   *
+   *  An indirect_array is a reference to the actual elements of an array
+   *  specified by an ordered array of indices.  The way to get an
+   *  indirect_array is to call operator[](valarray<size_t>) on a valarray.
+   *  The returned indirect_array then permits carrying operations out on the
+   *  referenced subset of elements in the original valarray.
+   *
+   *  For example, if an indirect_array is obtained using the array (4,2,0) as
+   *  an argument, and then assigned to an array containing (1,2,3), then the
+   *  underlying array will have array[0]==3, array[2]==2, and array[4]==1.
+   *
+   *  @param  Tp  Element type.
+   */
+  template <class _Tp>
+    class indirect_array
+    {
+    public:
+      typedef _Tp value_type;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
+      ///  Copy constructor.  Both slices refer to the same underlying array.
+      indirect_array(const indirect_array&);
+
+      ///  Assignment operator.  Assigns elements to corresponding elements
+      ///  of @a a.
+      indirect_array& operator=(const indirect_array&);
+
+      ///  Assign slice elements to corresponding elements of @a v.
+      void operator=(const valarray<_Tp>&) const;
+      ///  Multiply slice elements by corresponding elements of @a v.
+      void operator*=(const valarray<_Tp>&) const;
+      ///  Divide slice elements by corresponding elements of @a v.
+      void operator/=(const valarray<_Tp>&) const;
+      ///  Modulo slice elements by corresponding elements of @a v.
+      void operator%=(const valarray<_Tp>&) const;
+      ///  Add corresponding elements of @a v to slice elements.
+      void operator+=(const valarray<_Tp>&) const;
+      ///  Subtract corresponding elements of @a v from slice elements.
+      void operator-=(const valarray<_Tp>&) const;
+      ///  Logical xor slice elements with corresponding elements of @a v.
+      void operator^=(const valarray<_Tp>&) const;
+      ///  Logical and slice elements with corresponding elements of @a v.
+      void operator&=(const valarray<_Tp>&) const;
+      ///  Logical or slice elements with corresponding elements of @a v.
+      void operator|=(const valarray<_Tp>&) const;
+      ///  Left shift slice elements by corresponding elements of @a v.
+      void operator<<=(const valarray<_Tp>&) const;
+      ///  Right shift slice elements by corresponding elements of @a v.
+      void operator>>=(const valarray<_Tp>&) const;
+      ///  Assign all slice elements to @a t.
+      void operator= (const _Tp&) const;
+      //    ~indirect_array();
+
+      template<class _Dom>
+      void operator=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator*=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator/=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator%=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator+=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator-=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator^=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator&=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator|=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator<<=(const _Expr<_Dom, _Tp>&) const;
+      template<class _Dom>
+      void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+    private:
+      ///  Copy constructor.  Both slices refer to the same underlying array.
+      indirect_array(_Array<_Tp>, size_t, _Array<size_t>);
+
+      friend class valarray<_Tp>;
+      friend class gslice_array<_Tp>;
+
+      const size_t	 _M_sz;
+      const _Array<size_t> _M_index;
+      const _Array<_Tp>	 _M_array;
+
+      // not implemented
+      indirect_array();
+    };
+
+  template<typename _Tp>
+    inline
+    indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
+    : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
+
+  template<typename _Tp>
+    inline
+    indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s,
+					_Array<size_t> __i)
+    : _M_sz(__s), _M_index(__i), _M_array(__a) {}
+
+  template<typename _Tp>
+    inline indirect_array<_Tp>&
+    indirect_array<_Tp>::operator=(const indirect_array<_Tp>& __a)
+    {
+      std::__valarray_copy(__a._M_array, _M_sz, __a._M_index, _M_array,
+			   _M_index);
+      return *this;
+    }
+
+  template<typename _Tp>
+    inline void
+    indirect_array<_Tp>::operator=(const _Tp& __t) const
+    { std::__valarray_fill(_M_array, _M_index, _M_sz, __t); }
+
+  template<typename _Tp>
+    inline void
+    indirect_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+    { std::__valarray_copy(_Array<_Tp>(__v), _M_sz, _M_array, _M_index); }
+
+  template<typename _Tp>
+    template<class _Dom>
+      inline void
+      indirect_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const
+      { std::__valarray_copy(__e, _M_sz, _M_array, _M_index); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)				\
+  template<typename _Tp>						\
+    inline void								\
+    indirect_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const\
+    {									\
+      _Array_augmented_##_Name(_M_array, _M_index, _Array<_Tp>(__v), _M_sz); \
+    }									\
+									\
+  template<typename _Tp>                                                \
+    template<class _Dom>				                \
+      inline void							\
+      indirect_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\
+      {									\
+	_Array_augmented_##_Name(_M_array, _M_index, __e, _M_sz);	\
+      }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+  // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _INDIRECT_ARRAY_H */

+ 104 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/invoke.h

@@ -0,0 +1,104 @@
+// Implementation of INVOKE -*- C++ -*-
+
+// Copyright (C) 2016-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/bits/invoke.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{functional}
+ */
+
+#ifndef _GLIBCXX_INVOKE_H
+#define _GLIBCXX_INVOKE_H 1
+
+#pragma GCC system_header
+
+#if __cplusplus < 201103L
+# include <bits/c++0x_warning.h>
+#else
+
+#include <type_traits>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @addtogroup utilities
+   *  @{
+   */
+
+  // Used by __invoke_impl instead of std::forward<_Tp> so that a
+  // reference_wrapper is converted to an lvalue-reference.
+  template<typename _Tp, typename _Up = typename __inv_unwrap<_Tp>::type>
+    constexpr _Up&&
+    __invfwd(typename remove_reference<_Tp>::type& __t) noexcept
+    { return static_cast<_Up&&>(__t); }
+
+  template<typename _Res, typename _Fn, typename... _Args>
+    constexpr _Res
+    __invoke_impl(__invoke_other, _Fn&& __f, _Args&&... __args)
+    { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }
+
+  template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
+    constexpr _Res
+    __invoke_impl(__invoke_memfun_ref, _MemFun&& __f, _Tp&& __t,
+		  _Args&&... __args)
+    { return (__invfwd<_Tp>(__t).*__f)(std::forward<_Args>(__args)...); }
+
+  template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
+    constexpr _Res
+    __invoke_impl(__invoke_memfun_deref, _MemFun&& __f, _Tp&& __t,
+		  _Args&&... __args)
+    {
+      return ((*std::forward<_Tp>(__t)).*__f)(std::forward<_Args>(__args)...);
+    }
+
+  template<typename _Res, typename _MemPtr, typename _Tp>
+    constexpr _Res
+    __invoke_impl(__invoke_memobj_ref, _MemPtr&& __f, _Tp&& __t)
+    { return __invfwd<_Tp>(__t).*__f; }
+
+  template<typename _Res, typename _MemPtr, typename _Tp>
+    constexpr _Res
+    __invoke_impl(__invoke_memobj_deref, _MemPtr&& __f, _Tp&& __t)
+    { return (*std::forward<_Tp>(__t)).*__f; }
+
+  /// Invoke a callable object.
+  template<typename _Callable, typename... _Args>
+    constexpr typename __invoke_result<_Callable, _Args...>::type
+    __invoke(_Callable&& __fn, _Args&&... __args)
+    noexcept(__is_nothrow_invocable<_Callable, _Args...>::value)
+    {
+      using __result = __invoke_result<_Callable, _Args...>;
+      using __type = typename __result::type;
+      using __tag = typename __result::__invoke_type;
+      return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn),
+					std::forward<_Args>(__args)...);
+    }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif // C++11
+
+#endif // _GLIBCXX_INVOKE_H

+ 1079 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/ios_base.h

@@ -0,0 +1,1079 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/ios_base.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{ios}
+ */
+
+//
+// ISO C++ 14882: 27.4  Iostreams base classes
+//
+
+#ifndef _IOS_BASE_H
+#define _IOS_BASE_H 1
+
+#pragma GCC system_header
+
+#include <ext/atomicity.h>
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+
+#if __cplusplus < 201103L
+# include <stdexcept>
+#else
+# include <system_error>
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // The following definitions of bitmask types are enums, not ints,
+  // as permitted (but not required) in the standard, in order to provide
+  // better type safety in iostream calls.  A side effect is that in C++98
+  // expressions involving them are not compile-time constants.
+  enum _Ios_Fmtflags 
+    { 
+      _S_boolalpha 	= 1L << 0,
+      _S_dec 		= 1L << 1,
+      _S_fixed 		= 1L << 2,
+      _S_hex 		= 1L << 3,
+      _S_internal 	= 1L << 4,
+      _S_left 		= 1L << 5,
+      _S_oct 		= 1L << 6,
+      _S_right 		= 1L << 7,
+      _S_scientific 	= 1L << 8,
+      _S_showbase 	= 1L << 9,
+      _S_showpoint 	= 1L << 10,
+      _S_showpos 	= 1L << 11,
+      _S_skipws 	= 1L << 12,
+      _S_unitbuf 	= 1L << 13,
+      _S_uppercase 	= 1L << 14,
+      _S_adjustfield 	= _S_left | _S_right | _S_internal,
+      _S_basefield 	= _S_dec | _S_oct | _S_hex,
+      _S_floatfield 	= _S_scientific | _S_fixed,
+      _S_ios_fmtflags_end = 1L << 16,
+      _S_ios_fmtflags_max = __INT_MAX__,
+      _S_ios_fmtflags_min = ~__INT_MAX__
+    };
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
+  operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
+  operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
+  operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
+  operator~(_Ios_Fmtflags __a)
+  { return _Ios_Fmtflags(~static_cast<int>(__a)); }
+
+  inline const _Ios_Fmtflags&
+  operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Fmtflags&
+  operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Fmtflags&
+  operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Openmode 
+    { 
+      _S_app 		= 1L << 0,
+      _S_ate 		= 1L << 1,
+      _S_bin 		= 1L << 2,
+      _S_in 		= 1L << 3,
+      _S_out 		= 1L << 4,
+      _S_trunc 		= 1L << 5,
+      _S_ios_openmode_end = 1L << 16,
+      _S_ios_openmode_max = __INT_MAX__,
+      _S_ios_openmode_min = ~__INT_MAX__
+    };
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Openmode
+  operator&(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Openmode
+  operator|(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Openmode
+  operator^(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Openmode
+  operator~(_Ios_Openmode __a)
+  { return _Ios_Openmode(~static_cast<int>(__a)); }
+
+  inline const _Ios_Openmode&
+  operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Openmode&
+  operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Openmode&
+  operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Iostate
+    { 
+      _S_goodbit 		= 0,
+      _S_badbit 		= 1L << 0,
+      _S_eofbit 		= 1L << 1,
+      _S_failbit		= 1L << 2,
+      _S_ios_iostate_end = 1L << 16,
+      _S_ios_iostate_max = __INT_MAX__,
+      _S_ios_iostate_min = ~__INT_MAX__
+    };
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Iostate
+  operator&(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Iostate
+  operator|(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Iostate
+  operator^(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline _GLIBCXX_CONSTEXPR _Ios_Iostate
+  operator~(_Ios_Iostate __a)
+  { return _Ios_Iostate(~static_cast<int>(__a)); }
+
+  inline const _Ios_Iostate&
+  operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Iostate&
+  operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a & __b; }
+
+  inline const  _Ios_Iostate&
+  operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Seekdir 
+    { 
+      _S_beg = 0,
+      _S_cur = _GLIBCXX_STDIO_SEEK_CUR,
+      _S_end = _GLIBCXX_STDIO_SEEK_END,
+      _S_ios_seekdir_end = 1L << 16 
+    };
+
+#if __cplusplus >= 201103L
+  /// I/O error code
+  enum class io_errc { stream = 1 };
+
+  template <> struct is_error_code_enum<io_errc> : public true_type { };
+
+  const error_category& iostream_category() noexcept;
+
+  inline error_code
+  make_error_code(io_errc __e) noexcept
+  { return error_code(static_cast<int>(__e), iostream_category()); }
+
+  inline error_condition
+  make_error_condition(io_errc __e) noexcept
+  { return error_condition(static_cast<int>(__e), iostream_category()); }
+#endif
+
+  // 27.4.2  Class ios_base
+  /**
+   *  @brief  The base of the I/O class hierarchy.
+   *  @ingroup io
+   *
+   *  This class defines everything that can be defined about I/O that does
+   *  not depend on the type of characters being input or output.  Most
+   *  people will only see @c ios_base when they need to specify the full
+   *  name of the various I/O flags (e.g., the openmodes).
+  */
+  class ios_base
+  {
+#if _GLIBCXX_USE_CXX11_ABI
+#if __cplusplus < 201103L
+    // Type that is layout-compatible with std::system_error
+    struct system_error : std::runtime_error
+    {
+      // Type that is layout-compatible with std::error_code
+      struct error_code
+      {
+	error_code() { }
+      private:
+	int		_M_value;
+	const void*	_M_cat;
+      } _M_code;
+    };
+#endif
+#endif
+  public:
+
+    /** 
+     *  @brief These are thrown to indicate problems with io.
+     *  @ingroup exceptions
+     *
+     *  27.4.2.1.1  Class ios_base::failure
+     */
+#if _GLIBCXX_USE_CXX11_ABI
+    class _GLIBCXX_ABI_TAG_CXX11 failure : public system_error
+    {
+    public:
+      explicit
+      failure(const string& __str);
+
+#if __cplusplus >= 201103L
+      explicit
+      failure(const string&, const error_code&);
+
+      explicit
+      failure(const char*, const error_code& = io_errc::stream);
+#endif
+
+      virtual
+      ~failure() throw();
+
+      virtual const char*
+      what() const throw();
+    };
+#else
+    class failure : public exception
+    {
+    public:
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 48.  Use of non-existent exception constructor
+      explicit
+      failure(const string& __str) throw();
+
+      // This declaration is not useless:
+      // http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Vague-Linkage.html
+      virtual
+      ~failure() throw();
+
+      virtual const char*
+      what() const throw();
+
+    private:
+      string _M_msg;
+    };
+#endif
+
+    // 27.4.2.1.2  Type ios_base::fmtflags
+    /**
+     *  @brief This is a bitmask type.
+     *
+     *  @c @a _Ios_Fmtflags is implementation-defined, but it is valid to
+     *  perform bitwise operations on these values and expect the Right
+     *  Thing to happen.  Defined objects of type fmtflags are:
+     *  - boolalpha
+     *  - dec
+     *  - fixed
+     *  - hex
+     *  - internal
+     *  - left
+     *  - oct
+     *  - right
+     *  - scientific
+     *  - showbase
+     *  - showpoint
+     *  - showpos
+     *  - skipws
+     *  - unitbuf
+     *  - uppercase
+     *  - adjustfield
+     *  - basefield
+     *  - floatfield
+    */
+    typedef _Ios_Fmtflags fmtflags;
+
+    /// Insert/extract @c bool in alphabetic rather than numeric format.
+    static const fmtflags boolalpha =   _S_boolalpha;
+
+    /// Converts integer input or generates integer output in decimal base.
+    static const fmtflags dec =         _S_dec;
+
+    /// Generate floating-point output in fixed-point notation.
+    static const fmtflags fixed =       _S_fixed;
+
+    /// Converts integer input or generates integer output in hexadecimal base.
+    static const fmtflags hex =         _S_hex;
+
+    /// Adds fill characters at a designated internal point in certain
+    /// generated output, or identical to @c right if no such point is
+    /// designated.
+    static const fmtflags internal =    _S_internal;
+
+    /// Adds fill characters on the right (final positions) of certain
+    /// generated output.  (I.e., the thing you print is flush left.)
+    static const fmtflags left =        _S_left;
+
+    /// Converts integer input or generates integer output in octal base.
+    static const fmtflags oct =         _S_oct;
+
+    /// Adds fill characters on the left (initial positions) of certain
+    /// generated output.  (I.e., the thing you print is flush right.)
+    static const fmtflags right =       _S_right;
+
+    /// Generates floating-point output in scientific notation.
+    static const fmtflags scientific =  _S_scientific;
+
+    /// Generates a prefix indicating the numeric base of generated integer
+    /// output.
+    static const fmtflags showbase =    _S_showbase;
+
+    /// Generates a decimal-point character unconditionally in generated
+    /// floating-point output.
+    static const fmtflags showpoint =   _S_showpoint;
+
+    /// Generates a + sign in non-negative generated numeric output.
+    static const fmtflags showpos =     _S_showpos;
+
+    /// Skips leading white space before certain input operations.
+    static const fmtflags skipws =      _S_skipws;
+
+    /// Flushes output after each output operation.
+    static const fmtflags unitbuf =     _S_unitbuf;
+
+    /// Replaces certain lowercase letters with their uppercase equivalents
+    /// in generated output.
+    static const fmtflags uppercase =   _S_uppercase;
+
+    /// A mask of left|right|internal.  Useful for the 2-arg form of @c setf.
+    static const fmtflags adjustfield = _S_adjustfield;
+
+    /// A mask of dec|oct|hex.  Useful for the 2-arg form of @c setf.
+    static const fmtflags basefield =   _S_basefield;
+
+    /// A mask of scientific|fixed.  Useful for the 2-arg form of @c setf.
+    static const fmtflags floatfield =  _S_floatfield;
+
+    // 27.4.2.1.3  Type ios_base::iostate
+    /**
+     *  @brief This is a bitmask type.
+     *
+     *  @c @a _Ios_Iostate is implementation-defined, but it is valid to
+     *  perform bitwise operations on these values and expect the Right
+     *  Thing to happen.  Defined objects of type iostate are:
+     *  - badbit
+     *  - eofbit
+     *  - failbit
+     *  - goodbit
+    */
+    typedef _Ios_Iostate iostate;
+
+    /// Indicates a loss of integrity in an input or output sequence (such
+    /// as an irrecoverable read error from a file).
+    static const iostate badbit =	_S_badbit;
+
+    /// Indicates that an input operation reached the end of an input sequence.
+    static const iostate eofbit =	_S_eofbit;
+
+    /// Indicates that an input operation failed to read the expected
+    /// characters, or that an output operation failed to generate the
+    /// desired characters.
+    static const iostate failbit =	_S_failbit;
+
+    /// Indicates all is well.
+    static const iostate goodbit =	_S_goodbit;
+
+    // 27.4.2.1.4  Type ios_base::openmode
+    /**
+     *  @brief This is a bitmask type.
+     *
+     *  @c @a _Ios_Openmode is implementation-defined, but it is valid to
+     *  perform bitwise operations on these values and expect the Right
+     *  Thing to happen.  Defined objects of type openmode are:
+     *  - app
+     *  - ate
+     *  - binary
+     *  - in
+     *  - out
+     *  - trunc
+    */
+    typedef _Ios_Openmode openmode;
+
+    /// Seek to end before each write.
+    static const openmode app =		_S_app;
+
+    /// Open and seek to end immediately after opening.
+    static const openmode ate =		_S_ate;
+
+    /// Perform input and output in binary mode (as opposed to text mode).
+    /// This is probably not what you think it is; see
+    /// https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
+    static const openmode binary =	_S_bin;
+
+    /// Open for input.  Default for @c ifstream and fstream.
+    static const openmode in =		_S_in;
+
+    /// Open for output.  Default for @c ofstream and fstream.
+    static const openmode out =		_S_out;
+
+    /// Open for input.  Default for @c ofstream.
+    static const openmode trunc =	_S_trunc;
+
+    // 27.4.2.1.5  Type ios_base::seekdir
+    /**
+     *  @brief This is an enumerated type.
+     *
+     *  @c @a _Ios_Seekdir is implementation-defined.  Defined values
+     *  of type seekdir are:
+     *  - beg
+     *  - cur, equivalent to @c SEEK_CUR in the C standard library.
+     *  - end, equivalent to @c SEEK_END in the C standard library.
+    */
+    typedef _Ios_Seekdir seekdir;
+
+    /// Request a seek relative to the beginning of the stream.
+    static const seekdir beg =		_S_beg;
+
+    /// Request a seek relative to the current position within the sequence.
+    static const seekdir cur =		_S_cur;
+
+    /// Request a seek relative to the current end of the sequence.
+    static const seekdir end =		_S_end;
+
+    // Annex D.6
+    typedef int io_state;
+    typedef int open_mode;
+    typedef int seek_dir;
+
+    typedef std::streampos streampos;
+    typedef std::streamoff streamoff;
+
+    // Callbacks;
+    /**
+     *  @brief  The set of events that may be passed to an event callback.
+     *
+     *  erase_event is used during ~ios() and copyfmt().  imbue_event is used
+     *  during imbue().  copyfmt_event is used during copyfmt().
+    */
+    enum event
+    {
+      erase_event,
+      imbue_event,
+      copyfmt_event
+    };
+
+    /**
+     *  @brief  The type of an event callback function.
+     *  @param  __e  One of the members of the event enum.
+     *  @param  __b  Reference to the ios_base object.
+     *  @param  __i  The integer provided when the callback was registered.
+     *
+     *  Event callbacks are user defined functions that get called during
+     *  several ios_base and basic_ios functions, specifically imbue(),
+     *  copyfmt(), and ~ios().
+    */
+    typedef void (*event_callback) (event __e, ios_base& __b, int __i);
+
+    /**
+     *  @brief  Add the callback __fn with parameter __index.
+     *  @param  __fn  The function to add.
+     *  @param  __index  The integer to pass to the function when invoked.
+     *
+     *  Registers a function as an event callback with an integer parameter to
+     *  be passed to the function when invoked.  Multiple copies of the
+     *  function are allowed.  If there are multiple callbacks, they are
+     *  invoked in the order they were registered.
+    */
+    void
+    register_callback(event_callback __fn, int __index);
+
+  protected:
+    streamsize		_M_precision;
+    streamsize		_M_width;
+    fmtflags		_M_flags;
+    iostate		_M_exception;
+    iostate		_M_streambuf_state;
+
+    // 27.4.2.6  Members for callbacks
+    // 27.4.2.6  ios_base callbacks
+    struct _Callback_list
+    {
+      // Data Members
+      _Callback_list*		_M_next;
+      ios_base::event_callback	_M_fn;
+      int			_M_index;
+      _Atomic_word		_M_refcount;  // 0 means one reference.
+
+      _Callback_list(ios_base::event_callback __fn, int __index,
+		     _Callback_list* __cb)
+      : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
+
+      void
+      _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+      // 0 => OK to delete.
+      int
+      _M_remove_reference() 
+      {
+        // Be race-detector-friendly.  For more info see bits/c++config.
+        _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
+        int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
+        if (__res == 0)
+          {
+            _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
+          }
+        return __res;
+      }
+    };
+
+     _Callback_list*	_M_callbacks;
+
+    void
+    _M_call_callbacks(event __ev) throw();
+
+    void
+    _M_dispose_callbacks(void) throw();
+
+    // 27.4.2.5  Members for iword/pword storage
+    struct _Words
+    {
+      void*	_M_pword;
+      long	_M_iword;
+      _Words() : _M_pword(0), _M_iword(0) { }
+    };
+
+    // Only for failed iword/pword calls.
+    _Words		_M_word_zero;
+
+    // Guaranteed storage.
+    // The first 5 iword and pword slots are reserved for internal use.
+    enum { _S_local_word_size = 8 };
+    _Words		_M_local_word[_S_local_word_size];
+
+    // Allocated storage.
+    int			_M_word_size;
+    _Words*		_M_word;
+
+    _Words&
+    _M_grow_words(int __index, bool __iword);
+
+    // Members for locale and locale caching.
+    locale		_M_ios_locale;
+
+    void
+    _M_init() throw();
+
+  public:
+
+    // 27.4.2.1.6  Class ios_base::Init
+    // Used to initialize standard streams. In theory, g++ could use
+    // -finit-priority to order this stuff correctly without going
+    // through these machinations.
+    class Init
+    {
+      friend class ios_base;
+    public:
+      Init();
+      ~Init();
+
+    private:
+      static _Atomic_word	_S_refcount;
+      static bool		_S_synced_with_stdio;
+    };
+
+    // [27.4.2.2] fmtflags state functions
+    /**
+     *  @brief  Access to format flags.
+     *  @return  The format control flags for both input and output.
+    */
+    fmtflags
+    flags() const
+    { return _M_flags; }
+
+    /**
+     *  @brief  Setting new format flags all at once.
+     *  @param  __fmtfl  The new flags to set.
+     *  @return  The previous format control flags.
+     *
+     *  This function overwrites all the format flags with @a __fmtfl.
+    */
+    fmtflags
+    flags(fmtflags __fmtfl)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags = __fmtfl;
+      return __old;
+    }
+
+    /**
+     *  @brief  Setting new format flags.
+     *  @param  __fmtfl  Additional flags to set.
+     *  @return  The previous format control flags.
+     *
+     *  This function sets additional flags in format control.  Flags that
+     *  were previously set remain set.
+    */
+    fmtflags
+    setf(fmtflags __fmtfl)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags |= __fmtfl;
+      return __old;
+    }
+
+    /**
+     *  @brief  Setting new format flags.
+     *  @param  __fmtfl  Additional flags to set.
+     *  @param  __mask  The flags mask for @a fmtfl.
+     *  @return  The previous format control flags.
+     *
+     *  This function clears @a mask in the format flags, then sets
+     *  @a fmtfl @c & @a mask.  An example mask is @c ios_base::adjustfield.
+    */
+    fmtflags
+    setf(fmtflags __fmtfl, fmtflags __mask)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags &= ~__mask;
+      _M_flags |= (__fmtfl & __mask);
+      return __old;
+    }
+
+    /**
+     *  @brief  Clearing format flags.
+     *  @param  __mask  The flags to unset.
+     *
+     *  This function clears @a __mask in the format flags.
+    */
+    void
+    unsetf(fmtflags __mask)
+    { _M_flags &= ~__mask; }
+
+    /**
+     *  @brief  Flags access.
+     *  @return  The precision to generate on certain output operations.
+     *
+     *  Be careful if you try to give a definition of @a precision here; see
+     *  DR 189.
+    */
+    streamsize
+    precision() const
+    { return _M_precision; }
+
+    /**
+     *  @brief  Changing flags.
+     *  @param  __prec  The new precision value.
+     *  @return  The previous value of precision().
+    */
+    streamsize
+    precision(streamsize __prec)
+    {
+      streamsize __old = _M_precision;
+      _M_precision = __prec;
+      return __old;
+    }
+
+    /**
+     *  @brief  Flags access.
+     *  @return  The minimum field width to generate on output operations.
+     *
+     *  <em>Minimum field width</em> refers to the number of characters.
+    */
+    streamsize
+    width() const
+    { return _M_width; }
+
+    /**
+     *  @brief  Changing flags.
+     *  @param  __wide  The new width value.
+     *  @return  The previous value of width().
+    */
+    streamsize
+    width(streamsize __wide)
+    {
+      streamsize __old = _M_width;
+      _M_width = __wide;
+      return __old;
+    }
+
+    // [27.4.2.4] ios_base static members
+    /**
+     *  @brief  Interaction with the standard C I/O objects.
+     *  @param  __sync  Whether to synchronize or not.
+     *  @return  True if the standard streams were previously synchronized.
+     *
+     *  The synchronization referred to is @e only that between the standard
+     *  C facilities (e.g., stdout) and the standard C++ objects (e.g.,
+     *  cout).  User-declared streams are unaffected.  See
+     *  https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
+    */
+    static bool
+    sync_with_stdio(bool __sync = true);
+
+    // [27.4.2.3] ios_base locale functions
+    /**
+     *  @brief  Setting a new locale.
+     *  @param  __loc  The new locale.
+     *  @return  The previous locale.
+     *
+     *  Sets the new locale for this stream, and then invokes each callback
+     *  with imbue_event.
+    */
+    locale
+    imbue(const locale& __loc) throw();
+
+    /**
+     *  @brief  Locale access
+     *  @return  A copy of the current locale.
+     *
+     *  If @c imbue(loc) has previously been called, then this function
+     *  returns @c loc.  Otherwise, it returns a copy of @c std::locale(),
+     *  the global C++ locale.
+    */
+    locale
+    getloc() const
+    { return _M_ios_locale; }
+
+    /**
+     *  @brief  Locale access
+     *  @return  A reference to the current locale.
+     *
+     *  Like getloc above, but returns a reference instead of
+     *  generating a copy.
+    */
+    const locale&
+    _M_getloc() const
+    { return _M_ios_locale; }
+
+    // [27.4.2.5] ios_base storage functions
+    /**
+     *  @brief  Access to unique indices.
+     *  @return  An integer different from all previous calls.
+     *
+     *  This function returns a unique integer every time it is called.  It
+     *  can be used for any purpose, but is primarily intended to be a unique
+     *  index for the iword and pword functions.  The expectation is that an
+     *  application calls xalloc in order to obtain an index in the iword and
+     *  pword arrays that can be used without fear of conflict.
+     *
+     *  The implementation maintains a static variable that is incremented and
+     *  returned on each invocation.  xalloc is guaranteed to return an index
+     *  that is safe to use in the iword and pword arrays.
+    */
+    static int
+    xalloc() throw();
+
+    /**
+     *  @brief  Access to integer array.
+     *  @param  __ix  Index into the array.
+     *  @return  A reference to an integer associated with the index.
+     *
+     *  The iword function provides access to an array of integers that can be
+     *  used for any purpose.  The array grows as required to hold the
+     *  supplied index.  All integers in the array are initialized to 0.
+     *
+     *  The implementation reserves several indices.  You should use xalloc to
+     *  obtain an index that is safe to use.  Also note that since the array
+     *  can grow dynamically, it is not safe to hold onto the reference.
+    */
+    long&
+    iword(int __ix)
+    {
+      _Words& __word = (__ix < _M_word_size)
+			? _M_word[__ix] : _M_grow_words(__ix, true);
+      return __word._M_iword;
+    }
+
+    /**
+     *  @brief  Access to void pointer array.
+     *  @param  __ix  Index into the array.
+     *  @return  A reference to a void* associated with the index.
+     *
+     *  The pword function provides access to an array of pointers that can be
+     *  used for any purpose.  The array grows as required to hold the
+     *  supplied index.  All pointers in the array are initialized to 0.
+     *
+     *  The implementation reserves several indices.  You should use xalloc to
+     *  obtain an index that is safe to use.  Also note that since the array
+     *  can grow dynamically, it is not safe to hold onto the reference.
+    */
+    void*&
+    pword(int __ix)
+    {
+      _Words& __word = (__ix < _M_word_size)
+			? _M_word[__ix] : _M_grow_words(__ix, false);
+      return __word._M_pword;
+    }
+
+    // Destructor
+    /**
+     *  Invokes each callback with erase_event.  Destroys local storage.
+     *
+     *  Note that the ios_base object for the standard streams never gets
+     *  destroyed.  As a result, any callbacks registered with the standard
+     *  streams will not get invoked with erase_event (unless copyfmt is
+     *  used).
+    */
+    virtual ~ios_base();
+
+  protected:
+    ios_base() throw ();
+
+#if __cplusplus < 201103L
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 50.  Copy constructor and assignment operator of ios_base
+  private:
+    ios_base(const ios_base&);
+
+    ios_base&
+    operator=(const ios_base&);
+#else
+  public:
+    ios_base(const ios_base&) = delete;
+
+    ios_base&
+    operator=(const ios_base&) = delete;
+
+  protected:
+    void
+    _M_move(ios_base&) noexcept;
+
+    void
+    _M_swap(ios_base& __rhs) noexcept;
+#endif
+  };
+
+  // [27.4.5.1] fmtflags manipulators
+  /// Calls base.setf(ios_base::boolalpha).
+  inline ios_base&
+  boolalpha(ios_base& __base)
+  {
+    __base.setf(ios_base::boolalpha);
+    return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::boolalpha).
+  inline ios_base&
+  noboolalpha(ios_base& __base)
+  {
+    __base.unsetf(ios_base::boolalpha);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::showbase).
+  inline ios_base&
+  showbase(ios_base& __base)
+  {
+    __base.setf(ios_base::showbase);
+    return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::showbase).
+  inline ios_base&
+  noshowbase(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showbase);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::showpoint).
+  inline ios_base&
+  showpoint(ios_base& __base)
+  {
+    __base.setf(ios_base::showpoint);
+    return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::showpoint).
+  inline ios_base&
+  noshowpoint(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showpoint);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::showpos).
+  inline ios_base&
+  showpos(ios_base& __base)
+  {
+    __base.setf(ios_base::showpos);
+    return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::showpos).
+  inline ios_base&
+  noshowpos(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showpos);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::skipws).
+  inline ios_base&
+  skipws(ios_base& __base)
+  {
+    __base.setf(ios_base::skipws);
+    return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::skipws).
+  inline ios_base&
+  noskipws(ios_base& __base)
+  {
+    __base.unsetf(ios_base::skipws);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::uppercase).
+  inline ios_base&
+  uppercase(ios_base& __base)
+  {
+    __base.setf(ios_base::uppercase);
+    return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::uppercase).
+  inline ios_base&
+  nouppercase(ios_base& __base)
+  {
+    __base.unsetf(ios_base::uppercase);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::unitbuf).
+  inline ios_base&
+  unitbuf(ios_base& __base)
+  {
+     __base.setf(ios_base::unitbuf);
+     return __base;
+  }
+
+  /// Calls base.unsetf(ios_base::unitbuf).
+  inline ios_base&
+  nounitbuf(ios_base& __base)
+  {
+     __base.unsetf(ios_base::unitbuf);
+     return __base;
+  }
+
+  // [27.4.5.2] adjustfield manipulators
+  /// Calls base.setf(ios_base::internal, ios_base::adjustfield).
+  inline ios_base&
+  internal(ios_base& __base)
+  {
+     __base.setf(ios_base::internal, ios_base::adjustfield);
+     return __base;
+  }
+
+  /// Calls base.setf(ios_base::left, ios_base::adjustfield).
+  inline ios_base&
+  left(ios_base& __base)
+  {
+    __base.setf(ios_base::left, ios_base::adjustfield);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::right, ios_base::adjustfield).
+  inline ios_base&
+  right(ios_base& __base)
+  {
+    __base.setf(ios_base::right, ios_base::adjustfield);
+    return __base;
+  }
+
+  // [27.4.5.3] basefield manipulators
+  /// Calls base.setf(ios_base::dec, ios_base::basefield).
+  inline ios_base&
+  dec(ios_base& __base)
+  {
+    __base.setf(ios_base::dec, ios_base::basefield);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::hex, ios_base::basefield).
+  inline ios_base&
+  hex(ios_base& __base)
+  {
+    __base.setf(ios_base::hex, ios_base::basefield);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::oct, ios_base::basefield).
+  inline ios_base&
+  oct(ios_base& __base)
+  {
+    __base.setf(ios_base::oct, ios_base::basefield);
+    return __base;
+  }
+
+  // [27.4.5.4] floatfield manipulators
+  /// Calls base.setf(ios_base::fixed, ios_base::floatfield).
+  inline ios_base&
+  fixed(ios_base& __base)
+  {
+    __base.setf(ios_base::fixed, ios_base::floatfield);
+    return __base;
+  }
+
+  /// Calls base.setf(ios_base::scientific, ios_base::floatfield).
+  inline ios_base&
+  scientific(ios_base& __base)
+  {
+    __base.setf(ios_base::scientific, ios_base::floatfield);
+    return __base;
+  }
+
+#if __cplusplus >= 201103L
+  // New C++11 floatfield manipulators
+
+  /// Calls
+  /// base.setf(ios_base::fixed|ios_base::scientific, ios_base::floatfield)
+  inline ios_base&
+  hexfloat(ios_base& __base)
+  {
+    __base.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
+    return __base;
+  }
+
+  /// Calls @c base.unsetf(ios_base::floatfield)
+  inline ios_base&
+  defaultfloat(ios_base& __base)
+  {
+    __base.unsetf(ios_base::floatfield);
+    return __base;
+  }
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _IOS_BASE_H */

+ 1100 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/istream.tcc

@@ -0,0 +1,1100 @@
+// istream classes -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/istream.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{istream}
+ */
+
+//
+// ISO C++ 14882: 27.6.1  Input streams
+//
+
+#ifndef _ISTREAM_TCC
+#define _ISTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <bits/cxxabi_forced.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>::sentry::
+    sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      if (__in.good())
+	__try
+	  {
+	    if (__in.tie())
+	      __in.tie()->flush();
+	    if (!__noskip && bool(__in.flags() & ios_base::skipws))
+	      {
+		const __int_type __eof = traits_type::eof();
+		__streambuf_type* __sb = __in.rdbuf();
+		__int_type __c = __sb->sgetc();
+
+		const __ctype_type& __ct = __check_facet(__in._M_ctype);
+		while (!traits_type::eq_int_type(__c, __eof)
+		       && __ct.is(ctype_base::space,
+				  traits_type::to_char_type(__c)))
+		  __c = __sb->snextc();
+
+		// _GLIBCXX_RESOLVE_LIB_DEFECTS
+		// 195. Should basic_istream::sentry's constructor ever
+		// set eofbit?
+		if (traits_type::eq_int_type(__c, __eof))
+		  __err |= ios_base::eofbit;
+	      }
+	  }
+	__catch(__cxxabiv1::__forced_unwind&)
+	  {
+	    __in._M_setstate(ios_base::badbit);
+	    __throw_exception_again;
+	  }
+	__catch(...)
+	  { __in._M_setstate(ios_base::badbit); }
+
+      if (__in.good() && __err == ios_base::goodbit)
+	_M_ok = true;
+      else
+	{
+	  __err |= ios_base::failbit;
+	  __in.setstate(__err);
+	}
+    }
+
+  template<typename _CharT, typename _Traits>
+    template<typename _ValueT>
+      basic_istream<_CharT, _Traits>&
+      basic_istream<_CharT, _Traits>::
+      _M_extract(_ValueT& __v)
+      {
+	sentry __cerb(*this, false);
+	if (__cerb)
+	  {
+	    ios_base::iostate __err = ios_base::goodbit;
+	    __try
+	      {
+		const __num_get_type& __ng = __check_facet(this->_M_num_get);
+		__ng.get(*this, 0, *this, __err, __v);
+	      }
+	    __catch(__cxxabiv1::__forced_unwind&)
+	      {
+		this->_M_setstate(ios_base::badbit);
+		__throw_exception_again;
+	      }
+	    __catch(...)
+	      { this->_M_setstate(ios_base::badbit); }
+	    if (__err)
+	      this->setstate(__err);
+	  }
+	return *this;
+      }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    operator>>(short& __n)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 118. basic_istream uses nonexistent num_get member functions.
+      sentry __cerb(*this, false);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      long __l;
+	      const __num_get_type& __ng = __check_facet(this->_M_num_get);
+	      __ng.get(*this, 0, *this, __err, __l);
+
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 696. istream::operator>>(int&) broken.
+	      if (__l < __gnu_cxx::__numeric_traits<short>::__min)
+		{
+		  __err |= ios_base::failbit;
+		  __n = __gnu_cxx::__numeric_traits<short>::__min;
+		}
+	      else if (__l > __gnu_cxx::__numeric_traits<short>::__max)
+		{
+		  __err |= ios_base::failbit;
+		  __n = __gnu_cxx::__numeric_traits<short>::__max;
+		}
+	      else
+		__n = short(__l);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    operator>>(int& __n)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 118. basic_istream uses nonexistent num_get member functions.
+      sentry __cerb(*this, false);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      long __l;
+	      const __num_get_type& __ng = __check_facet(this->_M_num_get);
+	      __ng.get(*this, 0, *this, __err, __l);
+
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 696. istream::operator>>(int&) broken.
+	      if (__l < __gnu_cxx::__numeric_traits<int>::__min)
+		{
+		  __err |= ios_base::failbit;
+		  __n = __gnu_cxx::__numeric_traits<int>::__min;
+		}
+	      else if (__l > __gnu_cxx::__numeric_traits<int>::__max)
+		{
+		  __err |= ios_base::failbit;	      
+		  __n = __gnu_cxx::__numeric_traits<int>::__max;
+		}
+	      else
+		__n = int(__l);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    operator>>(__streambuf_type* __sbout)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, false);
+      if (__cerb && __sbout)
+	{
+	  __try
+	    {
+	      bool __ineof;
+	      if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
+		__err |= ios_base::failbit;
+	      if (__ineof)
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::failbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::failbit); }
+	}
+      else if (!__sbout)
+	__err |= ios_base::failbit;
+      if (__err)
+	this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_istream<_CharT, _Traits>::int_type
+    basic_istream<_CharT, _Traits>::
+    get(void)
+    {
+      const int_type __eof = traits_type::eof();
+      int_type __c = __eof;
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      __c = this->rdbuf()->sbumpc();
+	      // 27.6.1.1 paragraph 3
+	      if (!traits_type::eq_int_type(__c, __eof))
+		_M_gcount = 1;
+	      else
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	}
+      if (!_M_gcount)
+	__err |= ios_base::failbit;
+      if (__err)
+	this->setstate(__err);
+      return __c;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    get(char_type& __c)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      const int_type __cb = this->rdbuf()->sbumpc();
+	      // 27.6.1.1 paragraph 3
+	      if (!traits_type::eq_int_type(__cb, traits_type::eof()))
+		{
+		  _M_gcount = 1;
+		  __c = traits_type::to_char_type(__cb);
+		}
+	      else
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	}
+      if (!_M_gcount)
+	__err |= ios_base::failbit;
+      if (__err)
+	this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    get(char_type* __s, streamsize __n, char_type __delim)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      const int_type __idelim = traits_type::to_int_type(__delim);
+	      const int_type __eof = traits_type::eof();
+	      __streambuf_type* __sb = this->rdbuf();
+	      int_type __c = __sb->sgetc();
+
+	      while (_M_gcount + 1 < __n
+		     && !traits_type::eq_int_type(__c, __eof)
+		     && !traits_type::eq_int_type(__c, __idelim))
+		{
+		  *__s++ = traits_type::to_char_type(__c);
+		  ++_M_gcount;
+		  __c = __sb->snextc();
+		}
+	      if (traits_type::eq_int_type(__c, __eof))
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	}
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 243. get and getline when sentry reports failure.
+      if (__n > 0)
+	*__s = char_type();
+      if (!_M_gcount)
+	__err |= ios_base::failbit;
+      if (__err)
+	this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    get(__streambuf_type& __sb, char_type __delim)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      const int_type __idelim = traits_type::to_int_type(__delim);
+	      const int_type __eof = traits_type::eof();
+	      __streambuf_type* __this_sb = this->rdbuf();
+	      int_type __c = __this_sb->sgetc();
+	      char_type __c2 = traits_type::to_char_type(__c);
+
+	      while (!traits_type::eq_int_type(__c, __eof)
+		     && !traits_type::eq_int_type(__c, __idelim)
+		     && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
+		{
+		  ++_M_gcount;
+		  __c = __this_sb->snextc();
+		  __c2 = traits_type::to_char_type(__c);
+		}
+	      if (traits_type::eq_int_type(__c, __eof))
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	}
+      if (!_M_gcount)
+	__err |= ios_base::failbit;
+      if (__err)
+	this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    getline(char_type* __s, streamsize __n, char_type __delim)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+        {
+          __try
+            {
+              const int_type __idelim = traits_type::to_int_type(__delim);
+              const int_type __eof = traits_type::eof();
+              __streambuf_type* __sb = this->rdbuf();
+              int_type __c = __sb->sgetc();
+
+              while (_M_gcount + 1 < __n
+                     && !traits_type::eq_int_type(__c, __eof)
+                     && !traits_type::eq_int_type(__c, __idelim))
+                {
+                  *__s++ = traits_type::to_char_type(__c);
+                  __c = __sb->snextc();
+                  ++_M_gcount;
+                }
+              if (traits_type::eq_int_type(__c, __eof))
+                __err |= ios_base::eofbit;
+              else
+                {
+                  if (traits_type::eq_int_type(__c, __idelim))
+                    {
+                      __sb->sbumpc();
+                      ++_M_gcount;
+                    }
+                  else
+                    __err |= ios_base::failbit;
+                }
+            }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+          __catch(...)
+            { this->_M_setstate(ios_base::badbit); }
+        }
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 243. get and getline when sentry reports failure.
+      if (__n > 0)
+	*__s = char_type();
+      if (!_M_gcount)
+        __err |= ios_base::failbit;
+      if (__err)
+        this->setstate(__err);
+      return *this;
+    }
+
+  // We provide three overloads, since the first two are much simpler
+  // than the general case. Also, the latter two can thus adopt the
+  // same "batchy" strategy used by getline above.
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    ignore(void)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      const int_type __eof = traits_type::eof();
+	      __streambuf_type* __sb = this->rdbuf();
+
+	      if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
+		__err |= ios_base::eofbit;
+	      else
+		_M_gcount = 1;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    ignore(streamsize __n)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb && __n > 0)
+        {
+          ios_base::iostate __err = ios_base::goodbit;
+          __try
+            {
+              const int_type __eof = traits_type::eof();
+              __streambuf_type* __sb = this->rdbuf();
+              int_type __c = __sb->sgetc();
+
+	      // N.B. On LFS-enabled platforms streamsize is still 32 bits
+	      // wide: if we want to implement the standard mandated behavior
+	      // for n == max() (see 27.6.1.3/24) we are at risk of signed
+	      // integer overflow: thus these contortions. Also note that,
+	      // by definition, when more than 2G chars are actually ignored,
+	      // _M_gcount (the return value of gcount, that is) cannot be
+	      // really correct, being unavoidably too small.
+	      bool __large_ignore = false;
+	      while (true)
+		{
+		  while (_M_gcount < __n
+			 && !traits_type::eq_int_type(__c, __eof))
+		    {
+		      ++_M_gcount;
+		      __c = __sb->snextc();
+		    }
+		  if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+		      && !traits_type::eq_int_type(__c, __eof))
+		    {
+		      _M_gcount =
+			__gnu_cxx::__numeric_traits<streamsize>::__min;
+		      __large_ignore = true;
+		    }
+		  else
+		    break;
+		}
+
+	      if (__large_ignore)
+		_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+	      if (traits_type::eq_int_type(__c, __eof))
+                __err |= ios_base::eofbit;
+            }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+          __catch(...)
+            { this->_M_setstate(ios_base::badbit); }
+          if (__err)
+            this->setstate(__err);
+        }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    ignore(streamsize __n, int_type __delim)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb && __n > 0)
+        {
+          ios_base::iostate __err = ios_base::goodbit;
+          __try
+            {
+              const int_type __eof = traits_type::eof();
+              __streambuf_type* __sb = this->rdbuf();
+              int_type __c = __sb->sgetc();
+
+	      // See comment above.
+	      bool __large_ignore = false;
+	      while (true)
+		{
+		  while (_M_gcount < __n
+			 && !traits_type::eq_int_type(__c, __eof)
+			 && !traits_type::eq_int_type(__c, __delim))
+		    {
+		      ++_M_gcount;
+		      __c = __sb->snextc();
+		    }
+		  if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+		      && !traits_type::eq_int_type(__c, __eof)
+		      && !traits_type::eq_int_type(__c, __delim))
+		    {
+		      _M_gcount =
+			__gnu_cxx::__numeric_traits<streamsize>::__min;
+		      __large_ignore = true;
+		    }
+		  else
+		    break;
+		}
+
+	      if (__large_ignore)
+		_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+              if (traits_type::eq_int_type(__c, __eof))
+                __err |= ios_base::eofbit;
+	      else if (traits_type::eq_int_type(__c, __delim))
+		{
+		  if (_M_gcount
+		      < __gnu_cxx::__numeric_traits<streamsize>::__max)
+		    ++_M_gcount;
+		  __sb->sbumpc();
+		}
+            }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+          __catch(...)
+            { this->_M_setstate(ios_base::badbit); }
+          if (__err)
+            this->setstate(__err);
+        }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_istream<_CharT, _Traits>::int_type
+    basic_istream<_CharT, _Traits>::
+    peek(void)
+    {
+      int_type __c = traits_type::eof();
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      __c = this->rdbuf()->sgetc();
+	      if (traits_type::eq_int_type(__c, traits_type::eof()))
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return __c;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    read(char_type* __s, streamsize __n)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      _M_gcount = this->rdbuf()->sgetn(__s, __n);
+	      if (_M_gcount != __n)
+		__err |= (ios_base::eofbit | ios_base::failbit);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_istream<_CharT, _Traits>::
+    readsome(char_type* __s, streamsize __n)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      // Cannot compare int_type with streamsize generically.
+	      const streamsize __num = this->rdbuf()->in_avail();
+	      if (__num > 0)
+		_M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
+	      else if (__num == -1)
+		__err |= ios_base::eofbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return _M_gcount;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    putback(char_type __c)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 60. What is a formatted input function?
+      _M_gcount = 0;
+      // Clear eofbit per N3168.
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      const int_type __eof = traits_type::eof();
+	      __streambuf_type* __sb = this->rdbuf();
+	      if (!__sb
+		  || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
+		__err |= ios_base::badbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    unget(void)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 60. What is a formatted input function?
+      _M_gcount = 0;
+      // Clear eofbit per N3168.
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      const int_type __eof = traits_type::eof();
+	      __streambuf_type* __sb = this->rdbuf();
+	      if (!__sb
+		  || traits_type::eq_int_type(__sb->sungetc(), __eof))
+		__err |= ios_base::badbit;
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    int
+    basic_istream<_CharT, _Traits>::
+    sync(void)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // DR60.  Do not change _M_gcount.
+      int __ret = -1;
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      __streambuf_type* __sb = this->rdbuf();
+	      if (__sb)
+		{
+		  if (__sb->pubsync() == -1)
+		    __err |= ios_base::badbit;
+		  else
+		    __ret = 0;
+		}
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_istream<_CharT, _Traits>::pos_type
+    basic_istream<_CharT, _Traits>::
+    tellg(void)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // DR60.  Do not change _M_gcount.
+      pos_type __ret = pos_type(-1);
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      if (!this->fail())
+		__ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
+						  ios_base::in);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	}
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    seekg(pos_type __pos)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // DR60.  Do not change _M_gcount.
+      // Clear eofbit per N3168.
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      if (!this->fail())
+		{
+		  // 136.  seekp, seekg setting wrong streams?
+		  const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+								 ios_base::in);
+		  
+		  // 129.  Need error indication from seekp() and seekg()
+		  if (__p == pos_type(off_type(-1)))
+		    __err |= ios_base::failbit;
+		}
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    seekg(off_type __off, ios_base::seekdir __dir)
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // DR60.  Do not change _M_gcount.
+      // Clear eofbit per N3168.
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      if (!this->fail())
+		{
+		  // 136.  seekp, seekg setting wrong streams?
+		  const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+								 ios_base::in);
+	      
+		  // 129.  Need error indication from seekp() and seekg()
+		  if (__p == pos_type(off_type(-1)))
+		    __err |= ios_base::failbit;
+		}
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      this->_M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { this->_M_setstate(ios_base::badbit); }
+	  if (__err)
+	    this->setstate(__err);
+	}
+      return *this;
+    }
+
+  // 27.6.1.2.3 Character extraction templates
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
+    {
+      typedef basic_istream<_CharT, _Traits>		__istream_type;
+      typedef typename __istream_type::int_type         __int_type;
+
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+	{
+	  ios_base::iostate __err = ios_base::goodbit;
+	  __try
+	    {
+	      const __int_type __cb = __in.rdbuf()->sbumpc();
+	      if (!_Traits::eq_int_type(__cb, _Traits::eof()))
+		__c = _Traits::to_char_type(__cb);
+	      else
+		__err |= (ios_base::eofbit | ios_base::failbit);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      __in._M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { __in._M_setstate(ios_base::badbit); }
+	  if (__err)
+	    __in.setstate(__err);
+	}
+      return __in;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
+    {
+      typedef basic_istream<_CharT, _Traits>		__istream_type;
+      typedef basic_streambuf<_CharT, _Traits>          __streambuf_type;
+      typedef typename _Traits::int_type		int_type;
+      typedef _CharT					char_type;
+      typedef ctype<_CharT>				__ctype_type;
+
+      streamsize __extracted = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+	{
+	  __try
+	    {
+	      // Figure out how many characters to extract.
+	      streamsize __num = __in.width();
+	      if (__num <= 0)
+		__num = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+	      const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+
+	      const int_type __eof = _Traits::eof();
+	      __streambuf_type* __sb = __in.rdbuf();
+	      int_type __c = __sb->sgetc();
+
+	      while (__extracted < __num - 1
+		     && !_Traits::eq_int_type(__c, __eof)
+		     && !__ct.is(ctype_base::space,
+				 _Traits::to_char_type(__c)))
+		{
+		  *__s++ = _Traits::to_char_type(__c);
+		  ++__extracted;
+		  __c = __sb->snextc();
+		}
+	      if (_Traits::eq_int_type(__c, __eof))
+		__err |= ios_base::eofbit;
+
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 68.  Extractors for char* should store null at end
+	      *__s = char_type();
+	      __in.width(0);
+	    }
+	  __catch(__cxxabiv1::__forced_unwind&)
+	    {
+	      __in._M_setstate(ios_base::badbit);
+	      __throw_exception_again;
+	    }
+	  __catch(...)
+	    { __in._M_setstate(ios_base::badbit); }
+	}
+      if (!__extracted)
+	__err |= ios_base::failbit;
+      if (__err)
+	__in.setstate(__err);
+      return __in;
+    }
+
+  // 27.6.1.4 Standard basic_istream manipulators
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    ws(basic_istream<_CharT, _Traits>& __in)
+    {
+      typedef basic_istream<_CharT, _Traits>		__istream_type;
+      typedef basic_streambuf<_CharT, _Traits>          __streambuf_type;
+      typedef typename __istream_type::int_type		__int_type;
+      typedef ctype<_CharT>				__ctype_type;
+
+      const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+      const __int_type __eof = _Traits::eof();
+      __streambuf_type* __sb = __in.rdbuf();
+      __int_type __c = __sb->sgetc();
+
+      while (!_Traits::eq_int_type(__c, __eof)
+	     && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+	__c = __sb->snextc();
+
+       if (_Traits::eq_int_type(__c, __eof))
+	 __in.setstate(ios_base::eofbit);
+      return __in;
+    }
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class basic_istream<char>;
+  extern template istream& ws(istream&);
+  extern template istream& operator>>(istream&, char&);
+  extern template istream& operator>>(istream&, char*);
+  extern template istream& operator>>(istream&, unsigned char&);
+  extern template istream& operator>>(istream&, signed char&);
+  extern template istream& operator>>(istream&, unsigned char*);
+  extern template istream& operator>>(istream&, signed char*);
+
+  extern template istream& istream::_M_extract(unsigned short&);
+  extern template istream& istream::_M_extract(unsigned int&);  
+  extern template istream& istream::_M_extract(long&);
+  extern template istream& istream::_M_extract(unsigned long&);
+  extern template istream& istream::_M_extract(bool&);
+#ifdef _GLIBCXX_USE_LONG_LONG
+  extern template istream& istream::_M_extract(long long&);
+  extern template istream& istream::_M_extract(unsigned long long&);
+#endif
+  extern template istream& istream::_M_extract(float&);
+  extern template istream& istream::_M_extract(double&);
+  extern template istream& istream::_M_extract(long double&);
+  extern template istream& istream::_M_extract(void*&);
+
+  extern template class basic_iostream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class basic_istream<wchar_t>;
+  extern template wistream& ws(wistream&);
+  extern template wistream& operator>>(wistream&, wchar_t&);
+  extern template wistream& operator>>(wistream&, wchar_t*);
+
+  extern template wistream& wistream::_M_extract(unsigned short&);
+  extern template wistream& wistream::_M_extract(unsigned int&);  
+  extern template wistream& wistream::_M_extract(long&);
+  extern template wistream& wistream::_M_extract(unsigned long&);
+  extern template wistream& wistream::_M_extract(bool&);
+#ifdef _GLIBCXX_USE_LONG_LONG
+  extern template wistream& wistream::_M_extract(long long&);
+  extern template wistream& wistream::_M_extract(unsigned long long&);
+#endif
+  extern template wistream& wistream::_M_extract(float&);
+  extern template wistream& wistream::_M_extract(double&);
+  extern template wistream& wistream::_M_extract(long double&);
+  extern template wistream& wistream::_M_extract(void*&);
+
+  extern template class basic_iostream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 600 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/list.tcc

@@ -0,0 +1,600 @@
+// List implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file bits/list.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{list}
+ */
+
+#ifndef _LIST_TCC
+#define _LIST_TCC 1
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+
+  template<typename _Tp, typename _Alloc>
+    void
+    _List_base<_Tp, _Alloc>::
+    _M_clear() _GLIBCXX_NOEXCEPT
+    {
+      typedef _List_node<_Tp>  _Node;
+      __detail::_List_node_base* __cur = _M_impl._M_node._M_next;
+      while (__cur != &_M_impl._M_node)
+	{
+	  _Node* __tmp = static_cast<_Node*>(__cur);
+	  __cur = __tmp->_M_next;
+	  _Tp* __val = __tmp->_M_valptr();
+#if __cplusplus >= 201103L
+	  _Node_alloc_traits::destroy(_M_get_Node_allocator(), __val);
+#else
+	  _Tp_alloc_type(_M_get_Node_allocator()).destroy(__val);
+#endif
+	  _M_put_node(__tmp);
+	}
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+      typename list<_Tp, _Alloc>::iterator
+      list<_Tp, _Alloc>::
+      emplace(const_iterator __position, _Args&&... __args)
+      {
+	_Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+	__tmp->_M_hook(__position._M_const_cast()._M_node);
+	this->_M_inc_size(1);
+	return iterator(__tmp);
+      }
+#endif
+
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::iterator
+    list<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    insert(const_iterator __position, const value_type& __x)
+#else
+    insert(iterator __position, const value_type& __x)
+#endif
+    {
+      _Node* __tmp = _M_create_node(__x);
+      __tmp->_M_hook(__position._M_const_cast()._M_node);
+      this->_M_inc_size(1);
+      return iterator(__tmp);
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::iterator
+    list<_Tp, _Alloc>::
+    insert(const_iterator __position, size_type __n, const value_type& __x)
+    {
+      if (__n)
+	{
+	  list __tmp(__n, __x, get_allocator());
+	  iterator __it = __tmp.begin();
+	  splice(__position, __tmp);
+	  return __it;
+	}
+      return __position._M_const_cast();
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _InputIterator, typename>
+      typename list<_Tp, _Alloc>::iterator
+      list<_Tp, _Alloc>::
+      insert(const_iterator __position, _InputIterator __first,
+	     _InputIterator __last)
+      {
+	list __tmp(__first, __last, get_allocator());
+	if (!__tmp.empty())
+	  {
+	    iterator __it = __tmp.begin();
+	    splice(__position, __tmp);
+	    return __it;
+	  }
+	return __position._M_const_cast();
+      }
+#endif
+
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::iterator
+    list<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    erase(const_iterator __position) noexcept
+#else
+    erase(iterator __position)
+#endif
+    {
+      iterator __ret = iterator(__position._M_node->_M_next);
+      _M_erase(__position._M_const_cast());
+      return __ret;
+    }
+
+  // Return a const_iterator indicating the position to start inserting or
+  // erasing elements (depending whether the list is growing or shrinking),
+  // and set __new_size to the number of new elements that must be appended.
+  // Equivalent to the following, but performed optimally:
+  // if (__new_size < size()) {
+  //   __new_size = 0;
+  //   return std::next(begin(), __new_size);
+  // } else {
+  //   __newsize -= size();
+  //   return end();
+  // }
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::const_iterator
+    list<_Tp, _Alloc>::
+    _M_resize_pos(size_type& __new_size) const
+    {
+      const_iterator __i;
+#if _GLIBCXX_USE_CXX11_ABI
+      const size_type __len = size();
+      if (__new_size < __len)
+	{
+	  if (__new_size <= __len / 2)
+	    {
+	      __i = begin();
+	      std::advance(__i, __new_size);
+	    }
+	  else
+	    {
+	      __i = end();
+	      ptrdiff_t __num_erase = __len - __new_size;
+	      std::advance(__i, -__num_erase);
+	    }
+	  __new_size = 0;
+	  return __i;
+	}
+      else
+	__i = end();
+#else
+      size_type __len = 0;
+      for (__i = begin(); __i != end() && __len < __new_size; ++__i, ++__len)
+        ;
+#endif
+      __new_size -= __len;
+      return __i;
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    _M_default_append(size_type __n)
+    {
+      size_type __i = 0;
+      __try
+	{
+	  for (; __i < __n; ++__i)
+	    emplace_back();
+	}
+      __catch(...)
+	{
+	  for (; __i; --__i)
+	    pop_back();
+	  __throw_exception_again;
+	}
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    resize(size_type __new_size)
+    {
+      const_iterator __i = _M_resize_pos(__new_size);
+      if (__new_size)
+	_M_default_append(__new_size);
+      else
+        erase(__i, end());
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    resize(size_type __new_size, const value_type& __x)
+    {
+      const_iterator __i = _M_resize_pos(__new_size);
+      if (__new_size)
+        insert(end(), __new_size, __x);
+      else
+        erase(__i, end());
+    }
+#else
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    resize(size_type __new_size, value_type __x)
+    {
+      const_iterator __i = _M_resize_pos(__new_size);
+      if (__new_size)
+        insert(end(), __new_size, __x);
+      else
+        erase(__i._M_const_cast(), end());
+    }
+#endif
+
+  template<typename _Tp, typename _Alloc>
+    list<_Tp, _Alloc>&
+    list<_Tp, _Alloc>::
+    operator=(const list& __x)
+    {
+      if (this != std::__addressof(__x))
+	{
+#if __cplusplus >= 201103L
+	  if (_Node_alloc_traits::_S_propagate_on_copy_assign())
+	    {
+              auto& __this_alloc = this->_M_get_Node_allocator();
+              auto& __that_alloc = __x._M_get_Node_allocator();
+              if (!_Node_alloc_traits::_S_always_equal()
+	          && __this_alloc != __that_alloc)
+	        {
+		  // replacement allocator cannot free existing storage
+		  clear();
+		}
+	      std::__alloc_on_copy(__this_alloc, __that_alloc);
+            }
+#endif
+	  _M_assign_dispatch(__x.begin(), __x.end(), __false_type());
+	}
+      return *this;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    _M_fill_assign(size_type __n, const value_type& __val)
+    {
+      iterator __i = begin();
+      for (; __i != end() && __n > 0; ++__i, --__n)
+        *__i = __val;
+      if (__n > 0)
+        insert(end(), __n, __val);
+      else
+        erase(__i, end());
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _InputIterator>
+      void
+      list<_Tp, _Alloc>::
+      _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
+			 __false_type)
+      {
+        iterator __first1 = begin();
+        iterator __last1 = end();
+        for (; __first1 != __last1 && __first2 != __last2;
+	     ++__first1, ++__first2)
+          *__first1 = *__first2;
+        if (__first2 == __last2)
+          erase(__first1, __last1);
+        else
+          insert(__last1, __first2, __last2);
+      }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    remove(const value_type& __value)
+    {
+      iterator __first = begin();
+      iterator __last = end();
+      iterator __extra = __last;
+      while (__first != __last)
+	{
+	  iterator __next = __first;
+	  ++__next;
+	  if (*__first == __value)
+	    {
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 526. Is it undefined if a function in the standard changes
+	      // in parameters?
+	      if (std::__addressof(*__first) != std::__addressof(__value))
+		_M_erase(__first);
+	      else
+		__extra = __first;
+	    }
+	  __first = __next;
+	}
+      if (__extra != __last)
+	_M_erase(__extra);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    unique()
+    {
+      iterator __first = begin();
+      iterator __last = end();
+      if (__first == __last)
+	return;
+      iterator __next = __first;
+      while (++__next != __last)
+	{
+	  if (*__first == *__next)
+	    _M_erase(__next);
+	  else
+	    __first = __next;
+	  __next = __first;
+	}
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    merge(list&& __x)
+#else
+    merge(list& __x)
+#endif
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 300. list::merge() specification incomplete
+      if (this != std::__addressof(__x))
+	{
+	  _M_check_equal_allocators(__x);
+
+	  iterator __first1 = begin();
+	  iterator __last1 = end();
+	  iterator __first2 = __x.begin();
+	  iterator __last2 = __x.end();
+	  const size_t __orig_size = __x.size();
+	  __try {
+	    while (__first1 != __last1 && __first2 != __last2)
+	      if (*__first2 < *__first1)
+		{
+		  iterator __next = __first2;
+		  _M_transfer(__first1, __first2, ++__next);
+		  __first2 = __next;
+		}
+	      else
+		++__first1;
+	    if (__first2 != __last2)
+	      _M_transfer(__last1, __first2, __last2);
+
+	    this->_M_inc_size(__x._M_get_size());
+	    __x._M_set_size(0);
+	  }
+	  __catch(...)
+	    {
+	      const size_t __dist = std::distance(__first2, __last2);
+	      this->_M_inc_size(__orig_size - __dist);
+	      __x._M_set_size(__dist);
+	      __throw_exception_again;
+	    }
+	}
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _StrictWeakOrdering>
+      void
+      list<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+      merge(list&& __x, _StrictWeakOrdering __comp)
+#else
+      merge(list& __x, _StrictWeakOrdering __comp)
+#endif
+      {
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
+	// 300. list::merge() specification incomplete
+	if (this != std::__addressof(__x))
+	  {
+	    _M_check_equal_allocators(__x);
+
+	    iterator __first1 = begin();
+	    iterator __last1 = end();
+	    iterator __first2 = __x.begin();
+	    iterator __last2 = __x.end();
+	    const size_t __orig_size = __x.size();
+	    __try
+	      {
+		while (__first1 != __last1 && __first2 != __last2)
+		  if (__comp(*__first2, *__first1))
+		    {
+		      iterator __next = __first2;
+		      _M_transfer(__first1, __first2, ++__next);
+		      __first2 = __next;
+		    }
+		  else
+		    ++__first1;
+		if (__first2 != __last2)
+		  _M_transfer(__last1, __first2, __last2);
+
+		this->_M_inc_size(__x._M_get_size());
+		__x._M_set_size(0);
+	      }
+	    __catch(...)
+	      {
+		const size_t __dist = std::distance(__first2, __last2);
+		this->_M_inc_size(__orig_size - __dist);
+		__x._M_set_size(__dist);
+		__throw_exception_again;
+	      }
+	  }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    sort()
+    {
+      // Do nothing if the list has length 0 or 1.
+      if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+	  && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+      {
+        list __carry;
+        list __tmp[64];
+        list * __fill = __tmp;
+        list * __counter;
+	__try
+	  {
+	    do
+	      {
+		__carry.splice(__carry.begin(), *this, begin());
+
+		for(__counter = __tmp;
+		    __counter != __fill && !__counter->empty();
+		    ++__counter)
+		  {
+		    __counter->merge(__carry);
+		    __carry.swap(*__counter);
+		  }
+		__carry.swap(*__counter);
+		if (__counter == __fill)
+		  ++__fill;
+	      }
+	    while ( !empty() );
+
+	    for (__counter = __tmp + 1; __counter != __fill; ++__counter)
+	      __counter->merge(*(__counter - 1));
+	    swap( *(__fill - 1) );
+	  }
+	__catch(...)
+	  {
+	    this->splice(this->end(), __carry);
+	    for (int __i = 0; __i < sizeof(__tmp)/sizeof(__tmp[0]); ++__i)
+	      this->splice(this->end(), __tmp[__i]);
+	    __throw_exception_again;
+	  }
+      }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _Predicate>
+      void
+      list<_Tp, _Alloc>::
+      remove_if(_Predicate __pred)
+      {
+        iterator __first = begin();
+        iterator __last = end();
+        while (__first != __last)
+	  {
+	    iterator __next = __first;
+	    ++__next;
+	    if (__pred(*__first))
+	      _M_erase(__first);
+	    __first = __next;
+	  }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _BinaryPredicate>
+      void
+      list<_Tp, _Alloc>::
+      unique(_BinaryPredicate __binary_pred)
+      {
+        iterator __first = begin();
+        iterator __last = end();
+        if (__first == __last)
+	  return;
+        iterator __next = __first;
+        while (++__next != __last)
+	  {
+	    if (__binary_pred(*__first, *__next))
+	      _M_erase(__next);
+	    else
+	      __first = __next;
+	    __next = __first;
+	  }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _StrictWeakOrdering>
+      void
+      list<_Tp, _Alloc>::
+      sort(_StrictWeakOrdering __comp)
+      {
+	// Do nothing if the list has length 0 or 1.
+	if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+	    && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+	  {
+	    list __carry;
+	    list __tmp[64];
+	    list * __fill = __tmp;
+	    list * __counter;
+	    __try
+	      {
+		do
+		  {
+		    __carry.splice(__carry.begin(), *this, begin());
+
+		    for(__counter = __tmp;
+			__counter != __fill && !__counter->empty();
+			++__counter)
+		      {
+			__counter->merge(__carry, __comp);
+			__carry.swap(*__counter);
+		      }
+		    __carry.swap(*__counter);
+		    if (__counter == __fill)
+		      ++__fill;
+		  }
+		while ( !empty() );
+
+		for (__counter = __tmp + 1; __counter != __fill; ++__counter)
+		  __counter->merge(*(__counter - 1), __comp);
+		swap(*(__fill - 1));
+	      }
+	    __catch(...)
+	      {
+		this->splice(this->end(), __carry);
+		for (int __i = 0; __i < sizeof(__tmp)/sizeof(__tmp[0]); ++__i)
+		  this->splice(this->end(), __tmp[__i]);
+		__throw_exception_again;
+	      }
+	  }
+      }
+
+_GLIBCXX_END_NAMESPACE_CONTAINER
+} // namespace std
+
+#endif /* _LIST_TCC */
+

+ 853 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_classes.h

@@ -0,0 +1,853 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_classes.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#ifndef _LOCALE_CLASSES_H
+#define _LOCALE_CLASSES_H 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <string>
+#include <ext/atomicity.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // 22.1.1 Class locale
+  /**
+   *  @brief  Container class for localization functionality.
+   *  @ingroup locales
+   *
+   *  The locale class is first a class wrapper for C library locales.  It is
+   *  also an extensible container for user-defined localization.  A locale is
+   *  a collection of facets that implement various localization features such
+   *  as money, time, and number printing.
+   *
+   *  Constructing C++ locales does not change the C library locale.
+   *
+   *  This library supports efficient construction and copying of locales
+   *  through a reference counting implementation of the locale class.
+  */
+  class locale
+  {
+  public:
+    // Types:
+    /// Definition of locale::category.
+    typedef int	category;
+
+    // Forward decls and friends:
+    class facet;
+    class id;
+    class _Impl;
+
+    friend class facet;
+    friend class _Impl;
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Cache>
+      friend struct __use_cache;
+
+    //@{
+    /**
+     *  @brief  Category values.
+     *
+     *  The standard category values are none, ctype, numeric, collate, time,
+     *  monetary, and messages.  They form a bitmask that supports union and
+     *  intersection.  The category all is the union of these values.
+     *
+     *  NB: Order must match _S_facet_categories definition in locale.cc
+    */
+    static const category none		= 0;
+    static const category ctype		= 1L << 0;
+    static const category numeric	= 1L << 1;
+    static const category collate	= 1L << 2;
+    static const category time		= 1L << 3;
+    static const category monetary	= 1L << 4;
+    static const category messages	= 1L << 5;
+    static const category all		= (ctype | numeric | collate |
+					   time  | monetary | messages);
+    //@}
+
+    // Construct/copy/destroy:
+
+    /**
+     *  @brief  Default constructor.
+     *
+     *  Constructs a copy of the global locale.  If no locale has been
+     *  explicitly set, this is the C locale.
+    */
+    locale() throw();
+
+    /**
+     *  @brief  Copy constructor.
+     *
+     *  Constructs a copy of @a other.
+     *
+     *  @param  __other  The locale to copy.
+    */
+    locale(const locale& __other) throw();
+
+    /**
+     *  @brief  Named locale constructor.
+     *
+     *  Constructs a copy of the named C library locale.
+     *
+     *  @param  __s  Name of the locale to construct.
+     *  @throw  std::runtime_error if __s is null or an undefined locale.
+    */
+    explicit
+    locale(const char* __s);
+
+    /**
+     *  @brief  Construct locale with facets from another locale.
+     *
+     *  Constructs a copy of the locale @a base.  The facets specified by @a
+     *  cat are replaced with those from the locale named by @a s.  If base is
+     *  named, this locale instance will also be named.
+     *
+     *  @param  __base  The locale to copy.
+     *  @param  __s  Name of the locale to use facets from.
+     *  @param  __cat  Set of categories defining the facets to use from __s.
+     *  @throw  std::runtime_error if __s is null or an undefined locale.
+    */
+    locale(const locale& __base, const char* __s, category __cat);
+
+#if __cplusplus >= 201103L
+    /**
+     *  @brief  Named locale constructor.
+     *
+     *  Constructs a copy of the named C library locale.
+     *
+     *  @param  __s  Name of the locale to construct.
+     *  @throw  std::runtime_error if __s is an undefined locale.
+    */
+    explicit
+    locale(const std::string& __s) : locale(__s.c_str()) { }
+
+    /**
+     *  @brief  Construct locale with facets from another locale.
+     *
+     *  Constructs a copy of the locale @a base.  The facets specified by @a
+     *  cat are replaced with those from the locale named by @a s.  If base is
+     *  named, this locale instance will also be named.
+     *
+     *  @param  __base  The locale to copy.
+     *  @param  __s  Name of the locale to use facets from.
+     *  @param  __cat  Set of categories defining the facets to use from __s.
+     *  @throw  std::runtime_error if __s is an undefined locale.
+    */
+    locale(const locale& __base, const std::string& __s, category __cat)
+    : locale(__base, __s.c_str(), __cat) { }
+#endif
+
+    /**
+     *  @brief  Construct locale with facets from another locale.
+     *
+     *  Constructs a copy of the locale @a base.  The facets specified by @a
+     *  cat are replaced with those from the locale @a add.  If @a base and @a
+     *  add are named, this locale instance will also be named.
+     *
+     *  @param  __base  The locale to copy.
+     *  @param  __add  The locale to use facets from.
+     *  @param  __cat  Set of categories defining the facets to use from add.
+    */
+    locale(const locale& __base, const locale& __add, category __cat);
+
+    /**
+     *  @brief  Construct locale with another facet.
+     *
+     *  Constructs a copy of the locale @a __other.  The facet @a __f
+     *  is added to @a __other, replacing an existing facet of type
+     *  Facet if there is one.  If @a __f is null, this locale is a
+     *  copy of @a __other.
+     *
+     *  @param  __other  The locale to copy.
+     *  @param  __f  The facet to add in.
+    */
+    template<typename _Facet>
+      locale(const locale& __other, _Facet* __f);
+
+    /// Locale destructor.
+    ~locale() throw();
+
+    /**
+     *  @brief  Assignment operator.
+     *
+     *  Set this locale to be a copy of @a other.
+     *
+     *  @param  __other  The locale to copy.
+     *  @return  A reference to this locale.
+    */
+    const locale&
+    operator=(const locale& __other) throw();
+
+    /**
+     *  @brief  Construct locale with another facet.
+     *
+     *  Constructs and returns a new copy of this locale.  Adds or replaces an
+     *  existing facet of type Facet from the locale @a other into the new
+     *  locale.
+     *
+     *  @tparam  _Facet  The facet type to copy from other
+     *  @param  __other  The locale to copy from.
+     *  @return  Newly constructed locale.
+     *  @throw  std::runtime_error if __other has no facet of type _Facet.
+    */
+    template<typename _Facet>
+      locale
+      combine(const locale& __other) const;
+
+    // Locale operations:
+    /**
+     *  @brief  Return locale name.
+     *  @return  Locale name or "*" if unnamed.
+    */
+    _GLIBCXX_DEFAULT_ABI_TAG
+    string
+    name() const;
+
+    /**
+     *  @brief  Locale equality.
+     *
+     *  @param  __other  The locale to compare against.
+     *  @return  True if other and this refer to the same locale instance, are
+     *		 copies, or have the same name.  False otherwise.
+    */
+    bool
+    operator==(const locale& __other) const throw();
+
+    /**
+     *  @brief  Locale inequality.
+     *
+     *  @param  __other  The locale to compare against.
+     *  @return  ! (*this == __other)
+    */
+    bool
+    operator!=(const locale& __other) const throw()
+    { return !(this->operator==(__other)); }
+
+    /**
+     *  @brief  Compare two strings according to collate.
+     *
+     *  Template operator to compare two strings using the compare function of
+     *  the collate facet in this locale.  One use is to provide the locale to
+     *  the sort function.  For example, a vector v of strings could be sorted
+     *  according to locale loc by doing:
+     *  @code
+     *  std::sort(v.begin(), v.end(), loc);
+     *  @endcode
+     *
+     *  @param  __s1  First string to compare.
+     *  @param  __s2  Second string to compare.
+     *  @return  True if collate<_Char> facet compares __s1 < __s2, else false.
+    */
+    template<typename _Char, typename _Traits, typename _Alloc>
+      bool
+      operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
+		 const basic_string<_Char, _Traits, _Alloc>& __s2) const;
+
+    // Global locale objects:
+    /**
+     *  @brief  Set global locale
+     *
+     *  This function sets the global locale to the argument and returns a
+     *  copy of the previous global locale.  If the argument has a name, it
+     *  will also call std::setlocale(LC_ALL, loc.name()).
+     *
+     *  @param  __loc  The new locale to make global.
+     *  @return  Copy of the old global locale.
+    */
+    static locale
+    global(const locale& __loc);
+
+    /**
+     *  @brief  Return reference to the C locale.
+    */
+    static const locale&
+    classic();
+
+  private:
+    // The (shared) implementation
+    _Impl*		_M_impl;
+
+    // The "C" reference locale
+    static _Impl*       _S_classic;
+
+    // Current global locale
+    static _Impl*	_S_global;
+
+    // Names of underlying locale categories.
+    // NB: locale::global() has to know how to modify all the
+    // underlying categories, not just the ones required by the C++
+    // standard.
+    static const char* const* const _S_categories;
+
+    // Number of standard categories. For C++, these categories are
+    // collate, ctype, monetary, numeric, time, and messages. These
+    // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE,
+    // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE
+    // 1003.1-2001) specifies LC_MESSAGES.
+    // In addition to the standard categories, the underlying
+    // operating system is allowed to define extra LC_*
+    // macros. For GNU systems, the following are also valid:
+    // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT,
+    // and LC_IDENTIFICATION.
+    enum { _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES };
+
+#ifdef __GTHREADS
+    static __gthread_once_t _S_once;
+#endif
+
+    explicit
+    locale(_Impl*) throw();
+
+    static void
+    _S_initialize();
+
+    static void
+    _S_initialize_once() throw();
+
+    static category
+    _S_normalize_category(category);
+
+    void
+    _M_coalesce(const locale& __base, const locale& __add, category __cat);
+
+#if _GLIBCXX_USE_CXX11_ABI
+    static const id* const _S_twinned_facets[];
+#endif
+  };
+
+
+  // 22.1.1.1.2  Class locale::facet
+  /**
+   *  @brief  Localization functionality base class.
+   *  @ingroup locales
+   *
+   *  The facet class is the base class for a localization feature, such as
+   *  money, time, and number printing.  It provides common support for facets
+   *  and reference management.
+   *
+   *  Facets may not be copied or assigned.
+  */
+  class locale::facet
+  {
+  private:
+    friend class locale;
+    friend class locale::_Impl;
+
+    mutable _Atomic_word		_M_refcount;
+
+    // Contains data from the underlying "C" library for the classic locale.
+    static __c_locale                   _S_c_locale;
+
+    // String literal for the name of the classic locale.
+    static const char			_S_c_name[2];
+
+#ifdef __GTHREADS
+    static __gthread_once_t		_S_once;
+#endif
+
+    static void
+    _S_initialize_once();
+
+  protected:
+    /**
+     *  @brief  Facet constructor.
+     *
+     *  This is the constructor provided by the standard.  If refs is 0, the
+     *  facet is destroyed when the last referencing locale is destroyed.
+     *  Otherwise the facet will never be destroyed.
+     *
+     *  @param __refs  The initial value for reference count.
+    */
+    explicit
+    facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
+    { }
+
+    /// Facet destructor.
+    virtual
+    ~facet();
+
+    static void
+    _S_create_c_locale(__c_locale& __cloc, const char* __s,
+		       __c_locale __old = 0);
+
+    static __c_locale
+    _S_clone_c_locale(__c_locale& __cloc) throw();
+
+    static void
+    _S_destroy_c_locale(__c_locale& __cloc);
+
+    static __c_locale
+    _S_lc_ctype_c_locale(__c_locale __cloc, const char* __s);
+
+    // Returns data from the underlying "C" library data for the
+    // classic locale.
+    static __c_locale
+    _S_get_c_locale();
+
+    _GLIBCXX_CONST static const char*
+    _S_get_c_name() throw();
+
+#if __cplusplus < 201103L
+  private:
+    facet(const facet&);  // Not defined.
+
+    facet&
+    operator=(const facet&);  // Not defined.
+#else
+    facet(const facet&) = delete;
+
+    facet&
+    operator=(const facet&) = delete;
+#endif
+
+  private:
+    void
+    _M_add_reference() const throw()
+    { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+    void
+    _M_remove_reference() const throw()
+    {
+      // Be race-detector-friendly.  For more info see bits/c++config.
+      _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+	{
+          _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
+	  __try
+	    { delete this; }
+	  __catch(...)
+	    { }
+	}
+    }
+
+    const facet* _M_sso_shim(const id*) const;
+    const facet* _M_cow_shim(const id*) const;
+
+  protected:
+    class __shim; // For internal use only.
+  };
+
+
+  // 22.1.1.1.3 Class locale::id
+  /**
+   *  @brief  Facet ID class.
+   *  @ingroup locales
+   *
+   *  The ID class provides facets with an index used to identify them.
+   *  Every facet class must define a public static member locale::id, or be
+   *  derived from a facet that provides this member, otherwise the facet
+   *  cannot be used in a locale.  The locale::id ensures that each class
+   *  type gets a unique identifier.
+  */
+  class locale::id
+  {
+  private:
+    friend class locale;
+    friend class locale::_Impl;
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    // NB: There is no accessor for _M_index because it may be used
+    // before the constructor is run; the effect of calling a member
+    // function (even an inline) would be undefined.
+    mutable size_t		_M_index;
+
+    // Last id number assigned.
+    static _Atomic_word		_S_refcount;
+
+    void
+    operator=(const id&);  // Not defined.
+
+    id(const id&);  // Not defined.
+
+  public:
+    // NB: This class is always a static data member, and thus can be
+    // counted on to be zero-initialized.
+    /// Constructor.
+    id() { }
+
+    size_t
+    _M_id() const throw();
+  };
+
+
+  // Implementation object for locale.
+  class locale::_Impl
+  {
+  public:
+    // Friends.
+    friend class locale;
+    friend class locale::facet;
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Cache>
+      friend struct __use_cache;
+
+  private:
+    // Data Members.
+    _Atomic_word			_M_refcount;
+    const facet**			_M_facets;
+    size_t				_M_facets_size;
+    const facet**			_M_caches;
+    char**				_M_names;
+    static const locale::id* const	_S_id_ctype[];
+    static const locale::id* const	_S_id_numeric[];
+    static const locale::id* const	_S_id_collate[];
+    static const locale::id* const	_S_id_time[];
+    static const locale::id* const	_S_id_monetary[];
+    static const locale::id* const	_S_id_messages[];
+    static const locale::id* const* const _S_facet_categories[];
+
+    void
+    _M_add_reference() throw()
+    { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+    void
+    _M_remove_reference() throw()
+    {
+      // Be race-detector-friendly.  For more info see bits/c++config.
+      _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+	{
+          _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
+	  __try
+	    { delete this; }
+	  __catch(...)
+	    { }
+	}
+    }
+
+    _Impl(const _Impl&, size_t);
+    _Impl(const char*, size_t);
+    _Impl(size_t) throw();
+
+   ~_Impl() throw();
+
+    _Impl(const _Impl&);  // Not defined.
+
+    void
+    operator=(const _Impl&);  // Not defined.
+
+    bool
+    _M_check_same_name()
+    {
+      bool __ret = true;
+      if (_M_names[1])
+	// We must actually compare all the _M_names: can be all equal!
+	for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
+	  __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+      return __ret;
+    }
+
+    void
+    _M_replace_categories(const _Impl*, category);
+
+    void
+    _M_replace_category(const _Impl*, const locale::id* const*);
+
+    void
+    _M_replace_facet(const _Impl*, const locale::id*);
+
+    void
+    _M_install_facet(const locale::id*, const facet*);
+
+    template<typename _Facet>
+      void
+      _M_init_facet(_Facet* __facet)
+      { _M_install_facet(&_Facet::id, __facet); }
+
+    template<typename _Facet>
+      void
+      _M_init_facet_unchecked(_Facet* __facet)
+      {
+	__facet->_M_add_reference();
+	_M_facets[_Facet::id._M_id()] = __facet;
+      }
+
+    void
+    _M_install_cache(const facet*, size_t);
+
+    void _M_init_extra(facet**);
+    void _M_init_extra(void*, void*, const char*, const char*);
+  };
+
+
+  /**
+   *  @brief  Facet for localized string comparison.
+   *
+   *  This facet encapsulates the code to compare strings in a localized
+   *  manner.
+   *
+   *  The collate template uses protected virtual functions to provide
+   *  the actual results.  The public accessors forward the call to
+   *  the virtual functions.  These virtual functions are hooks for
+   *  developers to implement the behavior they require from the
+   *  collate facet.
+  */
+  template<typename _CharT>
+    class _GLIBCXX_NAMESPACE_CXX11 collate : public locale::facet
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+      //@}
+
+    protected:
+      // Underlying "C" library locale information saved from
+      // initialization, needed by collate_byname as well.
+      __c_locale			_M_c_locale_collate;
+
+    public:
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      collate(size_t __refs = 0)
+      : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
+      { }
+
+      /**
+       *  @brief  Internal constructor. Not for general use.
+       *
+       *  This is a constructor for use by the library itself to set up new
+       *  locales.
+       *
+       *  @param __cloc  The C locale.
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      collate(__c_locale __cloc, size_t __refs = 0)
+      : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
+      { }
+
+      /**
+       *  @brief  Compare two strings.
+       *
+       *  This function compares two strings and returns the result by calling
+       *  collate::do_compare().
+       *
+       *  @param __lo1  Start of string 1.
+       *  @param __hi1  End of string 1.
+       *  @param __lo2  Start of string 2.
+       *  @param __hi2  End of string 2.
+       *  @return  1 if string1 > string2, -1 if string1 < string2, else 0.
+      */
+      int
+      compare(const _CharT* __lo1, const _CharT* __hi1,
+	      const _CharT* __lo2, const _CharT* __hi2) const
+      { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
+
+      /**
+       *  @brief  Transform string to comparable form.
+       *
+       *  This function is a wrapper for strxfrm functionality.  It takes the
+       *  input string and returns a modified string that can be directly
+       *  compared to other transformed strings.  In the C locale, this
+       *  function just returns a copy of the input string.  In some other
+       *  locales, it may replace two chars with one, change a char for
+       *  another, etc.  It does so by returning collate::do_transform().
+       *
+       *  @param __lo  Start of string.
+       *  @param __hi  End of string.
+       *  @return  Transformed string_type.
+      */
+      string_type
+      transform(const _CharT* __lo, const _CharT* __hi) const
+      { return this->do_transform(__lo, __hi); }
+
+      /**
+       *  @brief  Return hash of a string.
+       *
+       *  This function computes and returns a hash on the input string.  It
+       *  does so by returning collate::do_hash().
+       *
+       *  @param __lo  Start of string.
+       *  @param __hi  End of string.
+       *  @return  Hash value.
+      */
+      long
+      hash(const _CharT* __lo, const _CharT* __hi) const
+      { return this->do_hash(__lo, __hi); }
+
+      // Used to abstract out _CharT bits in virtual member functions, below.
+      int
+      _M_compare(const _CharT*, const _CharT*) const throw();
+
+      size_t
+      _M_transform(_CharT*, const _CharT*, size_t) const throw();
+
+  protected:
+      /// Destructor.
+      virtual
+      ~collate()
+      { _S_destroy_c_locale(_M_c_locale_collate); }
+
+      /**
+       *  @brief  Compare two strings.
+       *
+       *  This function is a hook for derived classes to change the value
+       *  returned.  @see compare().
+       *
+       *  @param __lo1  Start of string 1.
+       *  @param __hi1  End of string 1.
+       *  @param __lo2  Start of string 2.
+       *  @param __hi2  End of string 2.
+       *  @return  1 if string1 > string2, -1 if string1 < string2, else 0.
+      */
+      virtual int
+      do_compare(const _CharT* __lo1, const _CharT* __hi1,
+		 const _CharT* __lo2, const _CharT* __hi2) const;
+
+      /**
+       *  @brief  Transform string to comparable form.
+       *
+       *  This function is a hook for derived classes to change the value
+       *  returned.
+       *
+       *  @param __lo  Start.
+       *  @param __hi  End.
+       *  @return  transformed string.
+      */
+      virtual string_type
+      do_transform(const _CharT* __lo, const _CharT* __hi) const;
+
+      /**
+       *  @brief  Return hash of a string.
+       *
+       *  This function computes and returns a hash on the input string.  This
+       *  function is a hook for derived classes to change the value returned.
+       *
+       *  @param __lo  Start of string.
+       *  @param __hi  End of string.
+       *  @return  Hash value.
+      */
+      virtual long
+      do_hash(const _CharT* __lo, const _CharT* __hi) const;
+    };
+
+  template<typename _CharT>
+    locale::id collate<_CharT>::id;
+
+  // Specializations.
+  template<>
+    int
+    collate<char>::_M_compare(const char*, const char*) const throw();
+
+  template<>
+    size_t
+    collate<char>::_M_transform(char*, const char*, size_t) const throw();
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    int
+    collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const throw();
+
+  template<>
+    size_t
+    collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const throw();
+#endif
+
+  /// class collate_byname [22.2.4.2].
+  template<typename _CharT>
+    class _GLIBCXX_NAMESPACE_CXX11 collate_byname : public collate<_CharT>
+    {
+    public:
+      //@{
+      /// Public typedefs
+      typedef _CharT               char_type;
+      typedef basic_string<_CharT> string_type;
+      //@}
+
+      explicit
+      collate_byname(const char* __s, size_t __refs = 0)
+      : collate<_CharT>(__refs)
+      {
+	if (__builtin_strcmp(__s, "C") != 0
+	    && __builtin_strcmp(__s, "POSIX") != 0)
+	  {
+	    this->_S_destroy_c_locale(this->_M_c_locale_collate);
+	    this->_S_create_c_locale(this->_M_c_locale_collate, __s);
+	  }
+      }
+
+#if __cplusplus >= 201103L
+      explicit
+      collate_byname(const string& __s, size_t __refs = 0)
+      : collate_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~collate_byname() { }
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+# include <bits/locale_classes.tcc>
+
+#endif

+ 298 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_classes.tcc

@@ -0,0 +1,298 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_classes.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#ifndef _LOCALE_CLASSES_TCC
+#define _LOCALE_CLASSES_TCC 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _Facet>
+    locale::
+    locale(const locale& __other, _Facet* __f)
+    {
+      _M_impl = new _Impl(*__other._M_impl, 1);
+
+      __try
+	{ _M_impl->_M_install_facet(&_Facet::id, __f); }
+      __catch(...)
+	{
+	  _M_impl->_M_remove_reference();
+	  __throw_exception_again;
+	}
+      delete [] _M_impl->_M_names[0];
+      _M_impl->_M_names[0] = 0;   // Unnamed.
+    }
+
+  template<typename _Facet>
+    locale
+    locale::
+    combine(const locale& __other) const
+    {
+      _Impl* __tmp = new _Impl(*_M_impl, 1);
+      __try
+	{
+	  __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
+	}
+      __catch(...)
+	{
+	  __tmp->_M_remove_reference();
+	  __throw_exception_again;
+	}
+      return locale(__tmp);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    bool
+    locale::
+    operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
+	       const basic_string<_CharT, _Traits, _Alloc>& __s2) const
+    {
+      typedef std::collate<_CharT> __collate_type;
+      const __collate_type& __collate = use_facet<__collate_type>(*this);
+      return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
+				__s2.data(), __s2.data() + __s2.length()) < 0);
+    }
+
+  /**
+   *  @brief  Test for the presence of a facet.
+   *  @ingroup locales
+   *
+   *  has_facet tests the locale argument for the presence of the facet type
+   *  provided as the template parameter.  Facets derived from the facet
+   *  parameter will also return true.
+   *
+   *  @tparam  _Facet  The facet type to test the presence of.
+   *  @param  __loc  The locale to test.
+   *  @return  true if @p __loc contains a facet of type _Facet, else false.
+  */
+  template<typename _Facet>
+    bool
+    has_facet(const locale& __loc) throw()
+    {
+      const size_t __i = _Facet::id._M_id();
+      const locale::facet** __facets = __loc._M_impl->_M_facets;
+      return (__i < __loc._M_impl->_M_facets_size
+#if __cpp_rtti
+	      && dynamic_cast<const _Facet*>(__facets[__i]));
+#else
+              && static_cast<const _Facet*>(__facets[__i]));
+#endif
+    }
+
+  /**
+   *  @brief  Return a facet.
+   *  @ingroup locales
+   *
+   *  use_facet looks for and returns a reference to a facet of type Facet
+   *  where Facet is the template parameter.  If has_facet(locale) is true,
+   *  there is a suitable facet to return.  It throws std::bad_cast if the
+   *  locale doesn't contain a facet of type Facet.
+   *
+   *  @tparam  _Facet  The facet type to access.
+   *  @param  __loc  The locale to use.
+   *  @return  Reference to facet of type Facet.
+   *  @throw  std::bad_cast if @p __loc doesn't contain a facet of type _Facet.
+  */
+  template<typename _Facet>
+    const _Facet&
+    use_facet(const locale& __loc)
+    {
+      const size_t __i = _Facet::id._M_id();
+      const locale::facet** __facets = __loc._M_impl->_M_facets;
+      if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
+        __throw_bad_cast();
+#if __cpp_rtti
+      return dynamic_cast<const _Facet&>(*__facets[__i]);
+#else
+      return static_cast<const _Facet&>(*__facets[__i]);
+#endif
+    }
+
+
+  // Generic version does nothing.
+  template<typename _CharT>
+    int
+    collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const throw ()
+    { return 0; }
+
+  // Generic version does nothing.
+  template<typename _CharT>
+    size_t
+    collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const throw ()
+    { return 0; }
+
+  template<typename _CharT>
+    int
+    collate<_CharT>::
+    do_compare(const _CharT* __lo1, const _CharT* __hi1,
+	       const _CharT* __lo2, const _CharT* __hi2) const
+    {
+      // strcoll assumes zero-terminated strings so we make a copy
+      // and then put a zero at the end.
+      const string_type __one(__lo1, __hi1);
+      const string_type __two(__lo2, __hi2);
+
+      const _CharT* __p = __one.c_str();
+      const _CharT* __pend = __one.data() + __one.length();
+      const _CharT* __q = __two.c_str();
+      const _CharT* __qend = __two.data() + __two.length();
+
+      // strcoll stops when it sees a nul character so we break
+      // the strings into zero-terminated substrings and pass those
+      // to strcoll.
+      for (;;)
+	{
+	  const int __res = _M_compare(__p, __q);
+	  if (__res)
+	    return __res;
+
+	  __p += char_traits<_CharT>::length(__p);
+	  __q += char_traits<_CharT>::length(__q);
+	  if (__p == __pend && __q == __qend)
+	    return 0;
+	  else if (__p == __pend)
+	    return -1;
+	  else if (__q == __qend)
+	    return 1;
+
+	  __p++;
+	  __q++;
+	}
+    }
+
+  template<typename _CharT>
+    typename collate<_CharT>::string_type
+    collate<_CharT>::
+    do_transform(const _CharT* __lo, const _CharT* __hi) const
+    {
+      string_type __ret;
+
+      // strxfrm assumes zero-terminated strings so we make a copy
+      const string_type __str(__lo, __hi);
+
+      const _CharT* __p = __str.c_str();
+      const _CharT* __pend = __str.data() + __str.length();
+
+      size_t __len = (__hi - __lo) * 2;
+
+      _CharT* __c = new _CharT[__len];
+
+      __try
+	{
+	  // strxfrm stops when it sees a nul character so we break
+	  // the string into zero-terminated substrings and pass those
+	  // to strxfrm.
+	  for (;;)
+	    {
+	      // First try a buffer perhaps big enough.
+	      size_t __res = _M_transform(__c, __p, __len);
+	      // If the buffer was not large enough, try again with the
+	      // correct size.
+	      if (__res >= __len)
+		{
+		  __len = __res + 1;
+		  delete [] __c, __c = 0;
+		  __c = new _CharT[__len];
+		  __res = _M_transform(__c, __p, __len);
+		}
+
+	      __ret.append(__c, __res);
+	      __p += char_traits<_CharT>::length(__p);
+	      if (__p == __pend)
+		break;
+
+	      __p++;
+	      __ret.push_back(_CharT());
+	    }
+	}
+      __catch(...)
+	{
+	  delete [] __c;
+	  __throw_exception_again;
+	}
+
+      delete [] __c;
+
+      return __ret;
+    }
+
+  template<typename _CharT>
+    long
+    collate<_CharT>::
+    do_hash(const _CharT* __lo, const _CharT* __hi) const
+    {
+      unsigned long __val = 0;
+      for (; __lo < __hi; ++__lo)
+	__val =
+	  *__lo + ((__val << 7)
+		   | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
+				__digits - 7)));
+      return static_cast<long>(__val);
+    }
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class collate<char>;
+  extern template class collate_byname<char>;
+
+  extern template
+    const collate<char>&
+    use_facet<collate<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<collate<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class collate<wchar_t>;
+  extern template class collate_byname<wchar_t>;
+
+  extern template
+    const collate<wchar_t>&
+    use_facet<collate<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<collate<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 549 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_conv.h

@@ -0,0 +1,549 @@
+// wstring_convert implementation -*- C++ -*-
+
+// Copyright (C) 2015-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_conv.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+#ifndef _LOCALE_CONV_H
+#define _LOCALE_CONV_H 1
+
+#if __cplusplus < 201103L
+# include <bits/c++0x_warning.h>
+#else
+
+#include <streambuf>
+#include "stringfwd.h"
+#include "allocator.h"
+#include "codecvt.h"
+#include "unique_ptr.h"
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @addtogroup locales
+   * @{
+   */
+
+  template<typename _OutStr, typename _InChar, typename _Codecvt,
+	   typename _State, typename _Fn>
+    bool
+    __do_str_codecvt(const _InChar* __first, const _InChar* __last,
+		     _OutStr& __outstr, const _Codecvt& __cvt, _State& __state,
+		     size_t& __count, _Fn __fn)
+    {
+      if (__first == __last)
+	{
+	  __outstr.clear();
+	  __count = 0;
+	  return true;
+	}
+
+      size_t __outchars = 0;
+      auto __next = __first;
+      const auto __maxlen = __cvt.max_length() + 1;
+
+      codecvt_base::result __result;
+      do
+	{
+	  __outstr.resize(__outstr.size() + (__last - __next) * __maxlen);
+	  auto __outnext = &__outstr.front() + __outchars;
+	  auto const __outlast = &__outstr.back() + 1;
+	  __result = (__cvt.*__fn)(__state, __next, __last, __next,
+					__outnext, __outlast, __outnext);
+	  __outchars = __outnext - &__outstr.front();
+	}
+      while (__result == codecvt_base::partial && __next != __last
+	     && (__outstr.size() - __outchars) < __maxlen);
+
+      if (__result == codecvt_base::error)
+	{
+	  __count = __next - __first;
+	  return false;
+	}
+
+      if (__result == codecvt_base::noconv)
+	{
+	  __outstr.assign(__first, __last);
+	  __count = __last - __first;
+	}
+      else
+	{
+	  __outstr.resize(__outchars);
+	  __count = __next - __first;
+	}
+
+      return true;
+    }
+
+  // Convert narrow character string to wide.
+  template<typename _CharT, typename _Traits, typename _Alloc, typename _State>
+    inline bool
+    __str_codecvt_in(const char* __first, const char* __last,
+		     basic_string<_CharT, _Traits, _Alloc>& __outstr,
+		     const codecvt<_CharT, char, _State>& __cvt,
+		     _State& __state, size_t& __count)
+    {
+      using _Codecvt = codecvt<_CharT, char, _State>;
+      using _ConvFn
+	= codecvt_base::result
+	  (_Codecvt::*)(_State&, const char*, const char*, const char*&,
+			_CharT*, _CharT*, _CharT*&) const;
+      _ConvFn __fn = &codecvt<_CharT, char, _State>::in;
+      return __do_str_codecvt(__first, __last, __outstr, __cvt, __state,
+			      __count, __fn);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc, typename _State>
+    inline bool
+    __str_codecvt_in(const char* __first, const char* __last,
+		     basic_string<_CharT, _Traits, _Alloc>& __outstr,
+		     const codecvt<_CharT, char, _State>& __cvt)
+    {
+      _State __state = {};
+      size_t __n;
+      return __str_codecvt_in(__first, __last, __outstr, __cvt, __state, __n);
+    }
+
+  // Convert wide character string to narrow.
+  template<typename _CharT, typename _Traits, typename _Alloc, typename _State>
+    inline bool
+    __str_codecvt_out(const _CharT* __first, const _CharT* __last,
+		      basic_string<char, _Traits, _Alloc>& __outstr,
+		      const codecvt<_CharT, char, _State>& __cvt,
+		      _State& __state, size_t& __count)
+    {
+      using _Codecvt = codecvt<_CharT, char, _State>;
+      using _ConvFn
+	= codecvt_base::result
+	  (_Codecvt::*)(_State&, const _CharT*, const _CharT*, const _CharT*&,
+			char*, char*, char*&) const;
+      _ConvFn __fn = &codecvt<_CharT, char, _State>::out;
+      return __do_str_codecvt(__first, __last, __outstr, __cvt, __state,
+			      __count, __fn);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc, typename _State>
+    inline bool
+    __str_codecvt_out(const _CharT* __first, const _CharT* __last,
+		      basic_string<char, _Traits, _Alloc>& __outstr,
+		      const codecvt<_CharT, char, _State>& __cvt)
+    {
+      _State __state = {};
+      size_t __n;
+      return __str_codecvt_out(__first, __last, __outstr, __cvt, __state, __n);
+    }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+
+  /// String conversions
+  template<typename _Codecvt, typename _Elem = wchar_t,
+	   typename _Wide_alloc = allocator<_Elem>,
+	   typename _Byte_alloc = allocator<char>>
+    class wstring_convert
+    {
+    public:
+      typedef basic_string<char, char_traits<char>, _Byte_alloc>   byte_string;
+      typedef basic_string<_Elem, char_traits<_Elem>, _Wide_alloc> wide_string;
+      typedef typename _Codecvt::state_type 			   state_type;
+      typedef typename wide_string::traits_type::int_type	   int_type;
+
+      /** Default constructor.
+       *
+       * @param  __pcvt The facet to use for conversions.
+       *
+       * Takes ownership of @p __pcvt and will delete it in the destructor.
+       */
+      explicit
+      wstring_convert(_Codecvt* __pcvt = new _Codecvt()) : _M_cvt(__pcvt)
+      {
+	if (!_M_cvt)
+	  __throw_logic_error("wstring_convert");
+      }
+
+      /** Construct with an initial converstion state.
+       *
+       * @param  __pcvt The facet to use for conversions.
+       * @param  __state Initial conversion state.
+       *
+       * Takes ownership of @p __pcvt and will delete it in the destructor.
+       * The object's conversion state will persist between conversions.
+       */
+      wstring_convert(_Codecvt* __pcvt, state_type __state)
+      : _M_cvt(__pcvt), _M_state(__state), _M_with_cvtstate(true)
+      {
+	if (!_M_cvt)
+	  __throw_logic_error("wstring_convert");
+      }
+
+      /** Construct with error strings.
+       *
+       * @param  __byte_err A string to return on failed conversions.
+       * @param  __wide_err A wide string to return on failed conversions.
+       */
+      explicit
+      wstring_convert(const byte_string& __byte_err,
+		      const wide_string& __wide_err = wide_string())
+      : _M_cvt(new _Codecvt),
+	_M_byte_err_string(__byte_err), _M_wide_err_string(__wide_err),
+	_M_with_strings(true)
+      {
+	if (!_M_cvt)
+	  __throw_logic_error("wstring_convert");
+      }
+
+      ~wstring_convert() = default;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2176. Special members for wstring_convert and wbuffer_convert
+      wstring_convert(const wstring_convert&) = delete;
+      wstring_convert& operator=(const wstring_convert&) = delete;
+
+      /// @{ Convert from bytes.
+      wide_string
+      from_bytes(char __byte)
+      {
+	char __bytes[2] = { __byte };
+	return from_bytes(__bytes, __bytes+1);
+      }
+
+      wide_string
+      from_bytes(const char* __ptr)
+      { return from_bytes(__ptr, __ptr+char_traits<char>::length(__ptr)); }
+
+      wide_string
+      from_bytes(const byte_string& __str)
+      {
+	auto __ptr = __str.data();
+	return from_bytes(__ptr, __ptr + __str.size());
+      }
+
+      wide_string
+      from_bytes(const char* __first, const char* __last)
+      {
+	if (!_M_with_cvtstate)
+	  _M_state = state_type();
+	wide_string __out{ _M_wide_err_string.get_allocator() };
+	if (__str_codecvt_in(__first, __last, __out, *_M_cvt, _M_state,
+			     _M_count))
+	  return __out;
+	if (_M_with_strings)
+	  return _M_wide_err_string;
+	__throw_range_error("wstring_convert::from_bytes");
+      }
+      /// @}
+
+      /// @{ Convert to bytes.
+      byte_string
+      to_bytes(_Elem __wchar)
+      {
+	_Elem __wchars[2] = { __wchar };
+	return to_bytes(__wchars, __wchars+1);
+      }
+
+      byte_string
+      to_bytes(const _Elem* __ptr)
+      {
+	return to_bytes(__ptr, __ptr+wide_string::traits_type::length(__ptr));
+      }
+
+      byte_string
+      to_bytes(const wide_string& __wstr)
+      {
+	auto __ptr = __wstr.data();
+	return to_bytes(__ptr, __ptr + __wstr.size());
+      }
+
+      byte_string
+      to_bytes(const _Elem* __first, const _Elem* __last)
+      {
+	if (!_M_with_cvtstate)
+	  _M_state = state_type();
+	byte_string __out{ _M_byte_err_string.get_allocator() };
+	if (__str_codecvt_out(__first, __last, __out, *_M_cvt, _M_state,
+			      _M_count))
+	  return __out;
+	if (_M_with_strings)
+	  return _M_byte_err_string;
+	__throw_range_error("wstring_convert::to_bytes");
+      }
+      /// @}
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2174. wstring_convert::converted() should be noexcept
+      /// The number of elements successfully converted in the last conversion.
+      size_t converted() const noexcept { return _M_count; }
+
+      /// The final conversion state of the last conversion.
+      state_type state() const { return _M_state; }
+
+    private:
+      unique_ptr<_Codecvt>	_M_cvt;
+      byte_string		_M_byte_err_string;
+      wide_string		_M_wide_err_string;
+      state_type		_M_state = state_type();
+      size_t			_M_count = 0;
+      bool			_M_with_cvtstate = false;
+      bool			_M_with_strings = false;
+    };
+
+_GLIBCXX_END_NAMESPACE_CXX11
+
+  /// Buffer conversions
+  template<typename _Codecvt, typename _Elem = wchar_t,
+	   typename _Tr = char_traits<_Elem>>
+    class wbuffer_convert : public basic_streambuf<_Elem, _Tr>
+    {
+      typedef basic_streambuf<_Elem, _Tr> _Wide_streambuf;
+
+    public:
+      typedef typename _Codecvt::state_type state_type;
+
+      /** Default constructor.
+       *
+       * @param  __bytebuf The underlying byte stream buffer.
+       * @param  __pcvt    The facet to use for conversions.
+       * @param  __state   Initial conversion state.
+       *
+       * Takes ownership of @p __pcvt and will delete it in the destructor.
+       */
+      explicit
+      wbuffer_convert(streambuf* __bytebuf = 0, _Codecvt* __pcvt = new _Codecvt,
+		      state_type __state = state_type())
+      : _M_buf(__bytebuf), _M_cvt(__pcvt), _M_state(__state)
+      {
+	if (!_M_cvt)
+	  __throw_logic_error("wbuffer_convert");
+
+	_M_always_noconv = _M_cvt->always_noconv();
+
+	if (_M_buf)
+	  {
+	    this->setp(_M_put_area, _M_put_area + _S_buffer_length);
+	    this->setg(_M_get_area + _S_putback_length,
+		       _M_get_area + _S_putback_length,
+		       _M_get_area + _S_putback_length);
+	  }
+      }
+
+      ~wbuffer_convert() = default;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2176. Special members for wstring_convert and wbuffer_convert
+      wbuffer_convert(const wbuffer_convert&) = delete;
+      wbuffer_convert& operator=(const wbuffer_convert&) = delete;
+
+      streambuf* rdbuf() const noexcept { return _M_buf; }
+
+      streambuf*
+      rdbuf(streambuf *__bytebuf) noexcept
+      {
+	auto __prev = _M_buf;
+	_M_buf = __bytebuf;
+	return __prev;
+      }
+
+      /// The conversion state following the last conversion.
+      state_type state() const noexcept { return _M_state; }
+
+    protected:
+      int
+      sync()
+      { return _M_buf && _M_conv_put() && !_M_buf->pubsync() ? 0 : -1; }
+
+      typename _Wide_streambuf::int_type
+      overflow(typename _Wide_streambuf::int_type __out)
+      {
+	if (!_M_buf || !_M_conv_put())
+	  return _Tr::eof();
+	else if (!_Tr::eq_int_type(__out, _Tr::eof()))
+	  return this->sputc(__out);
+	return _Tr::not_eof(__out);
+      }
+
+      typename _Wide_streambuf::int_type
+      underflow()
+      {
+	if (!_M_buf)
+	  return _Tr::eof();
+
+	if (this->gptr() < this->egptr() || (_M_buf && _M_conv_get()))
+	  return _Tr::to_int_type(*this->gptr());
+	else
+	  return _Tr::eof();
+      }
+
+      streamsize
+      xsputn(const typename _Wide_streambuf::char_type* __s, streamsize __n)
+      {
+	if (!_M_buf || __n == 0)
+	  return 0;
+	streamsize __done = 0;
+	do
+	{
+	  auto __nn = std::min<streamsize>(this->epptr() - this->pptr(),
+					   __n - __done);
+	  _Tr::copy(this->pptr(), __s + __done, __nn);
+	  this->pbump(__nn);
+	  __done += __nn;
+	} while (__done < __n && _M_conv_put());
+	return __done;
+      }
+
+    private:
+      // fill the get area from converted contents of the byte stream buffer
+      bool
+      _M_conv_get()
+      {
+	const streamsize __pb1 = this->gptr() - this->eback();
+	const streamsize __pb2 = _S_putback_length;
+	const streamsize __npb = std::min(__pb1, __pb2);
+
+	_Tr::move(_M_get_area + _S_putback_length - __npb,
+		  this->gptr() - __npb, __npb);
+
+	streamsize __nbytes = sizeof(_M_get_buf) - _M_unconv;
+	__nbytes = std::min(__nbytes, _M_buf->in_avail());
+	if (__nbytes < 1)
+	  __nbytes = 1;
+	__nbytes = _M_buf->sgetn(_M_get_buf + _M_unconv, __nbytes);
+	if (__nbytes < 1)
+	  return false;
+	__nbytes += _M_unconv;
+
+	// convert _M_get_buf into _M_get_area
+
+	_Elem* __outbuf = _M_get_area + _S_putback_length;
+	_Elem* __outnext = __outbuf;
+	const char* __bnext = _M_get_buf;
+
+	codecvt_base::result __result;
+	if (_M_always_noconv)
+	  __result = codecvt_base::noconv;
+	else
+	  {
+	    _Elem* __outend = _M_get_area + _S_buffer_length;
+
+	    __result = _M_cvt->in(_M_state,
+				  __bnext, __bnext + __nbytes, __bnext,
+				  __outbuf, __outend, __outnext);
+	  }
+
+	if (__result == codecvt_base::noconv)
+	  {
+	    // cast is safe because noconv means _Elem is same type as char
+	    auto __get_buf = reinterpret_cast<const _Elem*>(_M_get_buf);
+	    _Tr::copy(__outbuf, __get_buf, __nbytes);
+	    _M_unconv = 0;
+	    return true;
+	  }
+
+	if ((_M_unconv = _M_get_buf + __nbytes - __bnext))
+	  char_traits<char>::move(_M_get_buf, __bnext, _M_unconv);
+
+	this->setg(__outbuf, __outbuf, __outnext);
+
+	return __result != codecvt_base::error;
+      }
+
+      // unused
+      bool
+      _M_put(...)
+      { return false; }
+
+      bool
+      _M_put(const char* __p, streamsize __n)
+      {
+	if (_M_buf->sputn(__p, __n) < __n)
+	  return false;
+	return true;
+      }
+
+      // convert the put area and write to the byte stream buffer
+      bool
+      _M_conv_put()
+      {
+	_Elem* const __first = this->pbase();
+	const _Elem* const __last = this->pptr();
+	const streamsize __pending = __last - __first;
+
+	if (_M_always_noconv)
+	  return _M_put(__first, __pending);
+
+	char __outbuf[2 * _S_buffer_length];
+
+	const _Elem* __next = __first;
+	const _Elem* __start;
+	do
+	  {
+	    __start = __next;
+	    char* __outnext = __outbuf;
+	    char* const __outlast = __outbuf + sizeof(__outbuf);
+	    auto __result = _M_cvt->out(_M_state, __next, __last, __next,
+					__outnext, __outlast, __outnext);
+	    if (__result == codecvt_base::error)
+	      return false;
+	    else if (__result == codecvt_base::noconv)
+	      return _M_put(__next, __pending);
+
+	    if (!_M_put(__outbuf, __outnext - __outbuf))
+	      return false;
+	  }
+	while (__next != __last && __next != __start);
+
+	if (__next != __last)
+	  _Tr::move(__first, __next, __last - __next);
+
+	this->pbump(__first - __next);
+	return __next != __first;
+      }
+
+      streambuf*		_M_buf;
+      unique_ptr<_Codecvt>	_M_cvt;
+      state_type		_M_state;
+
+      static const streamsize	_S_buffer_length = 32;
+      static const streamsize	_S_putback_length = 3;
+      _Elem                     _M_put_area[_S_buffer_length];
+      _Elem                     _M_get_area[_S_buffer_length];
+      streamsize		_M_unconv = 0;
+      char			_M_get_buf[_S_buffer_length-_S_putback_length];
+      bool			_M_always_noconv;
+    };
+
+#endif  // _GLIBCXX_USE_WCHAR_T
+
+  /// @} group locales
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif // __cplusplus
+
+#endif /* _LOCALE_CONV_H */

+ 2653 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets.h

@@ -0,0 +1,2653 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_facets.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#ifndef _LOCALE_FACETS_H
+#define _LOCALE_FACETS_H 1
+
+#pragma GCC system_header
+
+#include <cwctype>	// For wctype_t
+#include <cctype>
+#include <bits/ctype_base.h>
+#include <iosfwd>
+#include <bits/ios_base.h>  // For ios_base, ios_base::iostate
+#include <streambuf>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/streambuf_iterator.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // NB: Don't instantiate required wchar_t facets if no wchar_t support.
+#ifdef _GLIBCXX_USE_WCHAR_T
+# define  _GLIBCXX_NUM_FACETS 28
+# define  _GLIBCXX_NUM_CXX11_FACETS 16
+#else
+# define  _GLIBCXX_NUM_FACETS 14
+# define  _GLIBCXX_NUM_CXX11_FACETS 8
+#endif
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+# define _GLIBCXX_NUM_UNICODE_FACETS 2
+#else
+# define _GLIBCXX_NUM_UNICODE_FACETS 0
+#endif
+
+  // Convert string to numeric value of type _Tp and store results.
+  // NB: This is specialized for all required types, there is no
+  // generic definition.
+  template<typename _Tp>
+    void
+    __convert_to_v(const char*, _Tp&, ios_base::iostate&,
+		   const __c_locale&) throw();
+
+  // Explicit specializations for required types.
+  template<>
+    void
+    __convert_to_v(const char*, float&, ios_base::iostate&,
+		   const __c_locale&) throw();
+
+  template<>
+    void
+    __convert_to_v(const char*, double&, ios_base::iostate&,
+		   const __c_locale&) throw();
+
+  template<>
+    void
+    __convert_to_v(const char*, long double&, ios_base::iostate&,
+		   const __c_locale&) throw();
+
+  // NB: __pad is a struct, rather than a function, so it can be
+  // partially-specialized.
+  template<typename _CharT, typename _Traits>
+    struct __pad
+    {
+      static void
+      _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
+	     const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
+    };
+
+  // Used by both numeric and monetary facets.
+  // Inserts "group separator" characters into an array of characters.
+  // It's recursive, one iteration per group.  It moves the characters
+  // in the buffer this way: "xxxx12345" -> "12,345xxx".  Call this
+  // only with __gsize != 0.
+  template<typename _CharT>
+    _CharT*
+    __add_grouping(_CharT* __s, _CharT __sep,
+		   const char* __gbeg, size_t __gsize,
+		   const _CharT* __first, const _CharT* __last);
+
+  // This template permits specializing facet output code for
+  // ostreambuf_iterator.  For ostreambuf_iterator, sputn is
+  // significantly more efficient than incrementing iterators.
+  template<typename _CharT>
+    inline
+    ostreambuf_iterator<_CharT>
+    __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
+    {
+      __s._M_put(__ws, __len);
+      return __s;
+    }
+
+  // This is the unspecialized form of the template.
+  template<typename _CharT, typename _OutIter>
+    inline
+    _OutIter
+    __write(_OutIter __s, const _CharT* __ws, int __len)
+    {
+      for (int __j = 0; __j < __len; __j++, ++__s)
+	*__s = __ws[__j];
+      return __s;
+    }
+
+
+  // 22.2.1.1  Template class ctype
+  // Include host and configuration specific ctype enums for ctype_base.
+
+  /**
+   *  @brief  Common base for ctype facet
+   *
+   *  This template class provides implementations of the public functions
+   *  that forward to the protected virtual functions.
+   *
+   *  This template also provides abstract stubs for the protected virtual
+   *  functions.
+  */
+  template<typename _CharT>
+    class __ctype_abstract_base : public locale::facet, public ctype_base
+    {
+    public:
+      // Types:
+      /// Typedef for the template parameter
+      typedef _CharT char_type;
+
+      /**
+       *  @brief  Test char_type classification.
+       *
+       *  This function finds a mask M for @a __c and compares it to
+       *  mask @a __m.  It does so by returning the value of
+       *  ctype<char_type>::do_is().
+       *
+       *  @param __c  The char_type to compare the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  (M & __m) != 0.
+      */
+      bool
+      is(mask __m, char_type __c) const
+      { return this->do_is(__m, __c); }
+
+      /**
+       *  @brief  Return a mask array.
+       *
+       *  This function finds the mask for each char_type in the range [lo,hi)
+       *  and successively writes it to vec.  vec must have as many elements
+       *  as the char array.  It does so by returning the value of
+       *  ctype<char_type>::do_is().
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      is(const char_type *__lo, const char_type *__hi, mask *__vec) const
+      { return this->do_is(__lo, __hi, __vec); }
+
+      /**
+       *  @brief  Find char_type matching a mask
+       *
+       *  This function searches for and returns the first char_type c in
+       *  [lo,hi) for which is(m,c) is true.  It does so by returning
+       *  ctype<char_type>::do_scan_is().
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to matching char_type if found, else @a __hi.
+      */
+      const char_type*
+      scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+      { return this->do_scan_is(__m, __lo, __hi); }
+
+      /**
+       *  @brief  Find char_type not matching a mask
+       *
+       *  This function searches for and returns the first char_type c in
+       *  [lo,hi) for which is(m,c) is false.  It does so by returning
+       *  ctype<char_type>::do_scan_not().
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to non-matching char if found, else @a __hi.
+      */
+      const char_type*
+      scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+      { return this->do_scan_not(__m, __lo, __hi); }
+
+      /**
+       *  @brief  Convert to uppercase.
+       *
+       *  This function converts the argument to uppercase if possible.
+       *  If not possible (for example, '2'), returns the argument.  It does
+       *  so by returning ctype<char_type>::do_toupper().
+       *
+       *  @param __c  The char_type to convert.
+       *  @return  The uppercase char_type if convertible, else @a __c.
+      */
+      char_type
+      toupper(char_type __c) const
+      { return this->do_toupper(__c); }
+
+      /**
+       *  @brief  Convert array to uppercase.
+       *
+       *  This function converts each char_type in the range [lo,hi) to
+       *  uppercase if possible.  Other elements remain untouched.  It does so
+       *  by returning ctype<char_type>:: do_toupper(lo, hi).
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      toupper(char_type *__lo, const char_type* __hi) const
+      { return this->do_toupper(__lo, __hi); }
+
+      /**
+       *  @brief  Convert to lowercase.
+       *
+       *  This function converts the argument to lowercase if possible.  If
+       *  not possible (for example, '2'), returns the argument.  It does so
+       *  by returning ctype<char_type>::do_tolower(c).
+       *
+       *  @param __c  The char_type to convert.
+       *  @return  The lowercase char_type if convertible, else @a __c.
+      */
+      char_type
+      tolower(char_type __c) const
+      { return this->do_tolower(__c); }
+
+      /**
+       *  @brief  Convert array to lowercase.
+       *
+       *  This function converts each char_type in the range [__lo,__hi) to
+       *  lowercase if possible.  Other elements remain untouched.  It does so
+       *  by returning ctype<char_type>:: do_tolower(__lo, __hi).
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      tolower(char_type* __lo, const char_type* __hi) const
+      { return this->do_tolower(__lo, __hi); }
+
+      /**
+       *  @brief  Widen char to char_type
+       *
+       *  This function converts the char argument to char_type using the
+       *  simplest reasonable transformation.  It does so by returning
+       *  ctype<char_type>::do_widen(c).
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The converted char_type.
+      */
+      char_type
+      widen(char __c) const
+      { return this->do_widen(__c); }
+
+      /**
+       *  @brief  Widen array to char_type
+       *
+       *  This function converts each char in the input to char_type using the
+       *  simplest reasonable transformation.  It does so by returning
+       *  ctype<char_type>::do_widen(c).
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      const char*
+      widen(const char* __lo, const char* __hi, char_type* __to) const
+      { return this->do_widen(__lo, __hi, __to); }
+
+      /**
+       *  @brief  Narrow char_type to char
+       *
+       *  This function converts the char_type to char using the simplest
+       *  reasonable transformation.  If the conversion fails, dfault is
+       *  returned instead.  It does so by returning
+       *  ctype<char_type>::do_narrow(__c).
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char_type to convert.
+       *  @param __dfault  Char to return if conversion fails.
+       *  @return  The converted char.
+      */
+      char
+      narrow(char_type __c, char __dfault) const
+      { return this->do_narrow(__c, __dfault); }
+
+      /**
+       *  @brief  Narrow array to char array
+       *
+       *  This function converts each char_type in the input to char using the
+       *  simplest reasonable transformation and writes the results to the
+       *  destination array.  For any char_type in the input that cannot be
+       *  converted, @a dfault is used instead.  It does so by returning
+       *  ctype<char_type>::do_narrow(__lo, __hi, __dfault, __to).
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      narrow(const char_type* __lo, const char_type* __hi,
+	      char __dfault, char* __to) const
+      { return this->do_narrow(__lo, __hi, __dfault, __to); }
+
+    protected:
+      explicit
+      __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
+
+      virtual
+      ~__ctype_abstract_base() { }
+
+      /**
+       *  @brief  Test char_type classification.
+       *
+       *  This function finds a mask M for @a c and compares it to mask @a m.
+       *
+       *  do_is() is a hook for a derived facet to change the behavior of
+       *  classifying.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __c  The char_type to find the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  (M & __m) != 0.
+      */
+      virtual bool
+      do_is(mask __m, char_type __c) const = 0;
+
+      /**
+       *  @brief  Return a mask array.
+       *
+       *  This function finds the mask for each char_type in the range [lo,hi)
+       *  and successively writes it to vec.  vec must have as many elements
+       *  as the input.
+       *
+       *  do_is() is a hook for a derived facet to change the behavior of
+       *  classifying.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi,
+	    mask* __vec) const = 0;
+
+      /**
+       *  @brief  Find char_type matching mask
+       *
+       *  This function searches for and returns the first char_type c in
+       *  [__lo,__hi) for which is(__m,c) is true.
+       *
+       *  do_scan_is() is a hook for a derived facet to change the behavior of
+       *  match searching.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a matching char_type if found, else @a __hi.
+      */
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo,
+		 const char_type* __hi) const = 0;
+
+      /**
+       *  @brief  Find char_type not matching mask
+       *
+       *  This function searches for and returns a pointer to the first
+       *  char_type c of [lo,hi) for which is(m,c) is false.
+       *
+       *  do_scan_is() is a hook for a derived facet to change the behavior of
+       *  match searching.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a non-matching char_type if found, else @a __hi.
+      */
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+		  const char_type* __hi) const = 0;
+
+      /**
+       *  @brief  Convert to uppercase.
+       *
+       *  This virtual function converts the char_type argument to uppercase
+       *  if possible.  If not possible (for example, '2'), returns the
+       *  argument.
+       *
+       *  do_toupper() is a hook for a derived facet to change the behavior of
+       *  uppercasing.  do_toupper() must always return the same result for
+       *  the same input.
+       *
+       *  @param __c  The char_type to convert.
+       *  @return  The uppercase char_type if convertible, else @a __c.
+      */
+      virtual char_type
+      do_toupper(char_type __c) const = 0;
+
+      /**
+       *  @brief  Convert array to uppercase.
+       *
+       *  This virtual function converts each char_type in the range [__lo,__hi)
+       *  to uppercase if possible.  Other elements remain untouched.
+       *
+       *  do_toupper() is a hook for a derived facet to change the behavior of
+       *  uppercasing.  do_toupper() must always return the same result for
+       *  the same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const = 0;
+
+      /**
+       *  @brief  Convert to lowercase.
+       *
+       *  This virtual function converts the argument to lowercase if
+       *  possible.  If not possible (for example, '2'), returns the argument.
+       *
+       *  do_tolower() is a hook for a derived facet to change the behavior of
+       *  lowercasing.  do_tolower() must always return the same result for
+       *  the same input.
+       *
+       *  @param __c  The char_type to convert.
+       *  @return  The lowercase char_type if convertible, else @a __c.
+      */
+      virtual char_type
+      do_tolower(char_type __c) const = 0;
+
+      /**
+       *  @brief  Convert array to lowercase.
+       *
+       *  This virtual function converts each char_type in the range [__lo,__hi)
+       *  to lowercase if possible.  Other elements remain untouched.
+       *
+       *  do_tolower() is a hook for a derived facet to change the behavior of
+       *  lowercasing.  do_tolower() must always return the same result for
+       *  the same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+
+      /**
+       *  @brief  Widen char
+       *
+       *  This virtual function converts the char to char_type using the
+       *  simplest reasonable transformation.
+       *
+       *  do_widen() is a hook for a derived facet to change the behavior of
+       *  widening.  do_widen() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The converted char_type
+      */
+      virtual char_type
+      do_widen(char __c) const = 0;
+
+      /**
+       *  @brief  Widen char array
+       *
+       *  This function converts each char in the input to char_type using the
+       *  simplest reasonable transformation.
+       *
+       *  do_widen() is a hook for a derived facet to change the behavior of
+       *  widening.  do_widen() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const = 0;
+
+      /**
+       *  @brief  Narrow char_type to char
+       *
+       *  This virtual function converts the argument to char using the
+       *  simplest reasonable transformation.  If the conversion fails, dfault
+       *  is returned instead.
+       *
+       *  do_narrow() is a hook for a derived facet to change the behavior of
+       *  narrowing.  do_narrow() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char_type to convert.
+       *  @param __dfault  Char to return if conversion fails.
+       *  @return  The converted char.
+      */
+      virtual char
+      do_narrow(char_type __c, char __dfault) const = 0;
+
+      /**
+       *  @brief  Narrow char_type array to char
+       *
+       *  This virtual function converts each char_type in the range
+       *  [__lo,__hi) to char using the simplest reasonable
+       *  transformation and writes the results to the destination
+       *  array.  For any element in the input that cannot be
+       *  converted, @a __dfault is used instead.
+       *
+       *  do_narrow() is a hook for a derived facet to change the behavior of
+       *  narrowing.  do_narrow() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+		char __dfault, char* __to) const = 0;
+    };
+
+  /**
+   *  @brief  Primary class template ctype facet.
+   *  @ingroup locales
+   *
+   *  This template class defines classification and conversion functions for
+   *  character sets.  It wraps cctype functionality.  Ctype gets used by
+   *  streams for many I/O operations.
+   *
+   *  This template provides the protected virtual functions the developer
+   *  will have to replace in a derived class or specialization to make a
+   *  working facet.  The public functions that access them are defined in
+   *  __ctype_abstract_base, to allow for implementation flexibility.  See
+   *  ctype<wchar_t> for an example.  The functions are documented in
+   *  __ctype_abstract_base.
+   *
+   *  Note: implementations are provided for all the protected virtual
+   *  functions, but will likely not be useful.
+  */
+  template<typename _CharT>
+    class ctype : public __ctype_abstract_base<_CharT>
+    {
+    public:
+      // Types:
+      typedef _CharT			char_type;
+      typedef typename __ctype_abstract_base<_CharT>::mask mask;
+
+      /// The facet id for ctype<char_type>
+      static locale::id			id;
+
+      explicit
+      ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
+
+   protected:
+      virtual
+      ~ctype();
+
+      virtual bool
+      do_is(mask __m, char_type __c) const;
+
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+		  const char_type* __hi) const;
+
+      virtual char_type
+      do_toupper(char_type __c) const;
+
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+
+      virtual char_type
+      do_tolower(char_type __c) const;
+
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+
+      virtual char_type
+      do_widen(char __c) const;
+
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+      virtual char
+      do_narrow(char_type, char __dfault) const;
+
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+		char __dfault, char* __to) const;
+    };
+
+  template<typename _CharT>
+    locale::id ctype<_CharT>::id;
+
+  /**
+   *  @brief  The ctype<char> specialization.
+   *  @ingroup locales
+   *
+   *  This class defines classification and conversion functions for
+   *  the char type.  It gets used by char streams for many I/O
+   *  operations.  The char specialization provides a number of
+   *  optimizations as well.
+  */
+  template<>
+    class ctype<char> : public locale::facet, public ctype_base
+    {
+    public:
+      // Types:
+      /// Typedef for the template parameter char.
+      typedef char		char_type;
+
+    protected:
+      // Data Members:
+      __c_locale		_M_c_locale_ctype;
+      bool			_M_del;
+      __to_type			_M_toupper;
+      __to_type			_M_tolower;
+      const mask*		_M_table;
+      mutable char		_M_widen_ok;
+      mutable char		_M_widen[1 + static_cast<unsigned char>(-1)];
+      mutable char		_M_narrow[1 + static_cast<unsigned char>(-1)];
+      mutable char		_M_narrow_ok;	// 0 uninitialized, 1 init,
+						// 2 memcpy can't be used
+
+    public:
+      /// The facet id for ctype<char>
+      static locale::id        id;
+      /// The size of the mask table.  It is SCHAR_MAX + 1.
+      static const size_t      table_size = 1 + static_cast<unsigned char>(-1);
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __table If non-zero, table is used as the per-char mask.
+       *               Else classic_table() is used.
+       *  @param __del   If true, passes ownership of table to this facet.
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+
+      /**
+       *  @brief  Constructor performs static initialization.
+       *
+       *  This constructor is used to construct the initial C locale facet.
+       *
+       *  @param __cloc  Handle to C locale data.
+       *  @param __table If non-zero, table is used as the per-char mask.
+       *  @param __del   If true, passes ownership of table to this facet.
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
+	    size_t __refs = 0);
+
+      /**
+       *  @brief  Test char classification.
+       *
+       *  This function compares the mask table[c] to @a __m.
+       *
+       *  @param __c  The char to compare the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  True if __m & table[__c] is true, false otherwise.
+      */
+      inline bool
+      is(mask __m, char __c) const;
+
+      /**
+       *  @brief  Return a mask array.
+       *
+       *  This function finds the mask for each char in the range [lo, hi) and
+       *  successively writes it to vec.  vec must have as many elements as
+       *  the char array.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
+      */
+      inline const char*
+      is(const char* __lo, const char* __hi, mask* __vec) const;
+
+      /**
+       *  @brief  Find char matching a mask
+       *
+       *  This function searches for and returns the first char in [lo,hi) for
+       *  which is(m,char) is true.
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a matching char if found, else @a __hi.
+      */
+      inline const char*
+      scan_is(mask __m, const char* __lo, const char* __hi) const;
+
+      /**
+       *  @brief  Find char not matching a mask
+       *
+       *  This function searches for and returns a pointer to the first char
+       *  in [__lo,__hi) for which is(m,char) is false.
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a non-matching char if found, else @a __hi.
+      */
+      inline const char*
+      scan_not(mask __m, const char* __lo, const char* __hi) const;
+
+      /**
+       *  @brief  Convert to uppercase.
+       *
+       *  This function converts the char argument to uppercase if possible.
+       *  If not possible (for example, '2'), returns the argument.
+       *
+       *  toupper() acts as if it returns ctype<char>::do_toupper(c).
+       *  do_toupper() must always return the same result for the same input.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The uppercase char if convertible, else @a __c.
+      */
+      char_type
+      toupper(char_type __c) const
+      { return this->do_toupper(__c); }
+
+      /**
+       *  @brief  Convert array to uppercase.
+       *
+       *  This function converts each char in the range [__lo,__hi) to uppercase
+       *  if possible.  Other chars remain untouched.
+       *
+       *  toupper() acts as if it returns ctype<char>:: do_toupper(__lo, __hi).
+       *  do_toupper() must always return the same result for the same input.
+       *
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      toupper(char_type *__lo, const char_type* __hi) const
+      { return this->do_toupper(__lo, __hi); }
+
+      /**
+       *  @brief  Convert to lowercase.
+       *
+       *  This function converts the char argument to lowercase if possible.
+       *  If not possible (for example, '2'), returns the argument.
+       *
+       *  tolower() acts as if it returns ctype<char>::do_tolower(__c).
+       *  do_tolower() must always return the same result for the same input.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The lowercase char if convertible, else @a __c.
+      */
+      char_type
+      tolower(char_type __c) const
+      { return this->do_tolower(__c); }
+
+      /**
+       *  @brief  Convert array to lowercase.
+       *
+       *  This function converts each char in the range [lo,hi) to lowercase
+       *  if possible.  Other chars remain untouched.
+       *
+       *  tolower() acts as if it returns ctype<char>:: do_tolower(__lo, __hi).
+       *  do_tolower() must always return the same result for the same input.
+       *
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      tolower(char_type* __lo, const char_type* __hi) const
+      { return this->do_tolower(__lo, __hi); }
+
+      /**
+       *  @brief  Widen char
+       *
+       *  This function converts the char to char_type using the simplest
+       *  reasonable transformation.  For an underived ctype<char> facet, the
+       *  argument will be returned unchanged.
+       *
+       *  This function works as if it returns ctype<char>::do_widen(c).
+       *  do_widen() must always return the same result for the same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The converted character.
+      */
+      char_type
+      widen(char __c) const
+      {
+	if (_M_widen_ok)
+	  return _M_widen[static_cast<unsigned char>(__c)];
+	this->_M_widen_init();
+	return this->do_widen(__c);
+      }
+
+      /**
+       *  @brief  Widen char array
+       *
+       *  This function converts each char in the input to char using the
+       *  simplest reasonable transformation.  For an underived ctype<char>
+       *  facet, the argument will be copied unchanged.
+       *
+       *  This function works as if it returns ctype<char>::do_widen(c).
+       *  do_widen() must always return the same result for the same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      const char*
+      widen(const char* __lo, const char* __hi, char_type* __to) const
+      {
+	if (_M_widen_ok == 1)
+	  {
+	    __builtin_memcpy(__to, __lo, __hi - __lo);
+	    return __hi;
+	  }
+	if (!_M_widen_ok)
+	  _M_widen_init();
+	return this->do_widen(__lo, __hi, __to);
+      }
+
+      /**
+       *  @brief  Narrow char
+       *
+       *  This function converts the char to char using the simplest
+       *  reasonable transformation.  If the conversion fails, dfault is
+       *  returned instead.  For an underived ctype<char> facet, @a c
+       *  will be returned unchanged.
+       *
+       *  This function works as if it returns ctype<char>::do_narrow(c).
+       *  do_narrow() must always return the same result for the same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @param __dfault  Char to return if conversion fails.
+       *  @return  The converted character.
+      */
+      char
+      narrow(char_type __c, char __dfault) const
+      {
+	if (_M_narrow[static_cast<unsigned char>(__c)])
+	  return _M_narrow[static_cast<unsigned char>(__c)];
+	const char __t = do_narrow(__c, __dfault);
+	if (__t != __dfault)
+	  _M_narrow[static_cast<unsigned char>(__c)] = __t;
+	return __t;
+      }
+
+      /**
+       *  @brief  Narrow char array
+       *
+       *  This function converts each char in the input to char using the
+       *  simplest reasonable transformation and writes the results to the
+       *  destination array.  For any char in the input that cannot be
+       *  converted, @a dfault is used instead.  For an underived ctype<char>
+       *  facet, the argument will be copied unchanged.
+       *
+       *  This function works as if it returns ctype<char>::do_narrow(lo, hi,
+       *  dfault, to).  do_narrow() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      const char_type*
+      narrow(const char_type* __lo, const char_type* __hi,
+	     char __dfault, char* __to) const
+      {
+	if (__builtin_expect(_M_narrow_ok == 1, true))
+	  {
+	    __builtin_memcpy(__to, __lo, __hi - __lo);
+	    return __hi;
+	  }
+	if (!_M_narrow_ok)
+	  _M_narrow_init();
+	return this->do_narrow(__lo, __hi, __dfault, __to);
+      }
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // DR 695. ctype<char>::classic_table() not accessible.
+      /// Returns a pointer to the mask table provided to the constructor, or
+      /// the default from classic_table() if none was provided.
+      const mask*
+      table() const throw()
+      { return _M_table; }
+
+      /// Returns a pointer to the C locale mask table.
+      static const mask*
+      classic_table() throw();
+    protected:
+
+      /**
+       *  @brief  Destructor.
+       *
+       *  This function deletes table() if @a del was true in the
+       *  constructor.
+      */
+      virtual
+      ~ctype();
+
+      /**
+       *  @brief  Convert to uppercase.
+       *
+       *  This virtual function converts the char argument to uppercase if
+       *  possible.  If not possible (for example, '2'), returns the argument.
+       *
+       *  do_toupper() is a hook for a derived facet to change the behavior of
+       *  uppercasing.  do_toupper() must always return the same result for
+       *  the same input.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The uppercase char if convertible, else @a __c.
+      */
+      virtual char_type
+      do_toupper(char_type __c) const;
+
+      /**
+       *  @brief  Convert array to uppercase.
+       *
+       *  This virtual function converts each char in the range [lo,hi) to
+       *  uppercase if possible.  Other chars remain untouched.
+       *
+       *  do_toupper() is a hook for a derived facet to change the behavior of
+       *  uppercasing.  do_toupper() must always return the same result for
+       *  the same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+
+      /**
+       *  @brief  Convert to lowercase.
+       *
+       *  This virtual function converts the char argument to lowercase if
+       *  possible.  If not possible (for example, '2'), returns the argument.
+       *
+       *  do_tolower() is a hook for a derived facet to change the behavior of
+       *  lowercasing.  do_tolower() must always return the same result for
+       *  the same input.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The lowercase char if convertible, else @a __c.
+      */
+      virtual char_type
+      do_tolower(char_type __c) const;
+
+      /**
+       *  @brief  Convert array to lowercase.
+       *
+       *  This virtual function converts each char in the range [lo,hi) to
+       *  lowercase if possible.  Other chars remain untouched.
+       *
+       *  do_tolower() is a hook for a derived facet to change the behavior of
+       *  lowercasing.  do_tolower() must always return the same result for
+       *  the same input.
+       *
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+
+      /**
+       *  @brief  Widen char
+       *
+       *  This virtual function converts the char to char using the simplest
+       *  reasonable transformation.  For an underived ctype<char> facet, the
+       *  argument will be returned unchanged.
+       *
+       *  do_widen() is a hook for a derived facet to change the behavior of
+       *  widening.  do_widen() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The converted character.
+      */
+      virtual char_type
+      do_widen(char __c) const
+      { return __c; }
+
+      /**
+       *  @brief  Widen char array
+       *
+       *  This function converts each char in the range [lo,hi) to char using
+       *  the simplest reasonable transformation.  For an underived
+       *  ctype<char> facet, the argument will be copied unchanged.
+       *
+       *  do_widen() is a hook for a derived facet to change the behavior of
+       *  widening.  do_widen() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const
+      {
+	__builtin_memcpy(__to, __lo, __hi - __lo);
+	return __hi;
+      }
+
+      /**
+       *  @brief  Narrow char
+       *
+       *  This virtual function converts the char to char using the simplest
+       *  reasonable transformation.  If the conversion fails, dfault is
+       *  returned instead.  For an underived ctype<char> facet, @a c will be
+       *  returned unchanged.
+       *
+       *  do_narrow() is a hook for a derived facet to change the behavior of
+       *  narrowing.  do_narrow() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @param __dfault  Char to return if conversion fails.
+       *  @return  The converted char.
+      */
+      virtual char
+      do_narrow(char_type __c, char __dfault __attribute__((__unused__))) const
+      { return __c; }
+
+      /**
+       *  @brief  Narrow char array to char array
+       *
+       *  This virtual function converts each char in the range [lo,hi) to
+       *  char using the simplest reasonable transformation and writes the
+       *  results to the destination array.  For any char in the input that
+       *  cannot be converted, @a dfault is used instead.  For an underived
+       *  ctype<char> facet, the argument will be copied unchanged.
+       *
+       *  do_narrow() is a hook for a derived facet to change the behavior of
+       *  narrowing.  do_narrow() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+		char __dfault __attribute__((__unused__)), char* __to) const
+      {
+	__builtin_memcpy(__to, __lo, __hi - __lo);
+	return __hi;
+      }
+
+    private:
+      void _M_narrow_init() const;
+      void _M_widen_init() const;
+    };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  /**
+   *  @brief  The ctype<wchar_t> specialization.
+   *  @ingroup locales
+   *
+   *  This class defines classification and conversion functions for the
+   *  wchar_t type.  It gets used by wchar_t streams for many I/O operations.
+   *  The wchar_t specialization provides a number of optimizations as well.
+   *
+   *  ctype<wchar_t> inherits its public methods from
+   *  __ctype_abstract_base<wchar_t>.
+  */
+  template<>
+    class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+    {
+    public:
+      // Types:
+      /// Typedef for the template parameter wchar_t.
+      typedef wchar_t		char_type;
+      typedef wctype_t		__wmask_type;
+
+    protected:
+      __c_locale		_M_c_locale_ctype;
+
+      // Pre-computed narrowed and widened chars.
+      bool                      _M_narrow_ok;
+      char                      _M_narrow[128];
+      wint_t                    _M_widen[1 + static_cast<unsigned char>(-1)];
+
+      // Pre-computed elements for do_is.
+      mask                      _M_bit[16];
+      __wmask_type              _M_wmask[16];
+
+    public:
+      // Data Members:
+      /// The facet id for ctype<wchar_t>
+      static locale::id		id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      ctype(size_t __refs = 0);
+
+      /**
+       *  @brief  Constructor performs static initialization.
+       *
+       *  This constructor is used to construct the initial C locale facet.
+       *
+       *  @param __cloc  Handle to C locale data.
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      ctype(__c_locale __cloc, size_t __refs = 0);
+
+    protected:
+      __wmask_type
+      _M_convert_to_wmask(const mask __m) const throw();
+
+      /// Destructor
+      virtual
+      ~ctype();
+
+      /**
+       *  @brief  Test wchar_t classification.
+       *
+       *  This function finds a mask M for @a c and compares it to mask @a m.
+       *
+       *  do_is() is a hook for a derived facet to change the behavior of
+       *  classifying.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __c  The wchar_t to find the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  (M & __m) != 0.
+      */
+      virtual bool
+      do_is(mask __m, char_type __c) const;
+
+      /**
+       *  @brief  Return a mask array.
+       *
+       *  This function finds the mask for each wchar_t in the range [lo,hi)
+       *  and successively writes it to vec.  vec must have as many elements
+       *  as the input.
+       *
+       *  do_is() is a hook for a derived facet to change the behavior of
+       *  classifying.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+      /**
+       *  @brief  Find wchar_t matching mask
+       *
+       *  This function searches for and returns the first wchar_t c in
+       *  [__lo,__hi) for which is(__m,c) is true.
+       *
+       *  do_scan_is() is a hook for a derived facet to change the behavior of
+       *  match searching.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a matching wchar_t if found, else @a __hi.
+      */
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+      /**
+       *  @brief  Find wchar_t not matching mask
+       *
+       *  This function searches for and returns a pointer to the first
+       *  wchar_t c of [__lo,__hi) for which is(__m,c) is false.
+       *
+       *  do_scan_is() is a hook for a derived facet to change the behavior of
+       *  match searching.  do_is() must always return the same result for the
+       *  same input.
+       *
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a non-matching wchar_t if found, else @a __hi.
+      */
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+		  const char_type* __hi) const;
+
+      /**
+       *  @brief  Convert to uppercase.
+       *
+       *  This virtual function converts the wchar_t argument to uppercase if
+       *  possible.  If not possible (for example, '2'), returns the argument.
+       *
+       *  do_toupper() is a hook for a derived facet to change the behavior of
+       *  uppercasing.  do_toupper() must always return the same result for
+       *  the same input.
+       *
+       *  @param __c  The wchar_t to convert.
+       *  @return  The uppercase wchar_t if convertible, else @a __c.
+      */
+      virtual char_type
+      do_toupper(char_type __c) const;
+
+      /**
+       *  @brief  Convert array to uppercase.
+       *
+       *  This virtual function converts each wchar_t in the range [lo,hi) to
+       *  uppercase if possible.  Other elements remain untouched.
+       *
+       *  do_toupper() is a hook for a derived facet to change the behavior of
+       *  uppercasing.  do_toupper() must always return the same result for
+       *  the same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+
+      /**
+       *  @brief  Convert to lowercase.
+       *
+       *  This virtual function converts the argument to lowercase if
+       *  possible.  If not possible (for example, '2'), returns the argument.
+       *
+       *  do_tolower() is a hook for a derived facet to change the behavior of
+       *  lowercasing.  do_tolower() must always return the same result for
+       *  the same input.
+       *
+       *  @param __c  The wchar_t to convert.
+       *  @return  The lowercase wchar_t if convertible, else @a __c.
+      */
+      virtual char_type
+      do_tolower(char_type __c) const;
+
+      /**
+       *  @brief  Convert array to lowercase.
+       *
+       *  This virtual function converts each wchar_t in the range [lo,hi) to
+       *  lowercase if possible.  Other elements remain untouched.
+       *
+       *  do_tolower() is a hook for a derived facet to change the behavior of
+       *  lowercasing.  do_tolower() must always return the same result for
+       *  the same input.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+
+      /**
+       *  @brief  Widen char to wchar_t
+       *
+       *  This virtual function converts the char to wchar_t using the
+       *  simplest reasonable transformation.  For an underived ctype<wchar_t>
+       *  facet, the argument will be cast to wchar_t.
+       *
+       *  do_widen() is a hook for a derived facet to change the behavior of
+       *  widening.  do_widen() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The char to convert.
+       *  @return  The converted wchar_t.
+      */
+      virtual char_type
+      do_widen(char __c) const;
+
+      /**
+       *  @brief  Widen char array to wchar_t array
+       *
+       *  This function converts each char in the input to wchar_t using the
+       *  simplest reasonable transformation.  For an underived ctype<wchar_t>
+       *  facet, the argument will be copied, casting each element to wchar_t.
+       *
+       *  do_widen() is a hook for a derived facet to change the behavior of
+       *  widening.  do_widen() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const;
+
+      /**
+       *  @brief  Narrow wchar_t to char
+       *
+       *  This virtual function converts the argument to char using
+       *  the simplest reasonable transformation.  If the conversion
+       *  fails, dfault is returned instead.  For an underived
+       *  ctype<wchar_t> facet, @a c will be cast to char and
+       *  returned.
+       *
+       *  do_narrow() is a hook for a derived facet to change the
+       *  behavior of narrowing.  do_narrow() must always return the
+       *  same result for the same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __c  The wchar_t to convert.
+       *  @param __dfault  Char to return if conversion fails.
+       *  @return  The converted char.
+      */
+      virtual char
+      do_narrow(char_type __c, char __dfault) const;
+
+      /**
+       *  @brief  Narrow wchar_t array to char array
+       *
+       *  This virtual function converts each wchar_t in the range [lo,hi) to
+       *  char using the simplest reasonable transformation and writes the
+       *  results to the destination array.  For any wchar_t in the input that
+       *  cannot be converted, @a dfault is used instead.  For an underived
+       *  ctype<wchar_t> facet, the argument will be copied, casting each
+       *  element to char.
+       *
+       *  do_narrow() is a hook for a derived facet to change the behavior of
+       *  narrowing.  do_narrow() must always return the same result for the
+       *  same input.
+       *
+       *  Note: this is not what you want for codepage conversions.  See
+       *  codecvt for that.
+       *
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
+      */
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+		char __dfault, char* __to) const;
+
+      // For use at construction time only.
+      void
+      _M_initialize_ctype() throw();
+    };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+  /// class ctype_byname [22.2.1.2].
+  template<typename _CharT>
+    class ctype_byname : public ctype<_CharT>
+    {
+    public:
+      typedef typename ctype<_CharT>::mask  mask;
+
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+#if __cplusplus >= 201103L
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0)
+      : ctype_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~ctype_byname() { };
+    };
+
+  /// 22.2.1.4  Class ctype_byname specializations.
+  template<>
+    class ctype_byname<char> : public ctype<char>
+    {
+    public:
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+#if __cplusplus >= 201103L
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0);
+#endif
+
+    protected:
+      virtual
+      ~ctype_byname();
+    };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    class ctype_byname<wchar_t> : public ctype<wchar_t>
+    {
+    public:
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+#if __cplusplus >= 201103L
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0);
+#endif
+
+    protected:
+      virtual
+      ~ctype_byname();
+    };
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+// Include host and configuration specific ctype inlines.
+#include <bits/ctype_inline.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // 22.2.2  The numeric category.
+  class __num_base
+  {
+  public:
+    // NB: Code depends on the order of _S_atoms_out elements.
+    // Below are the indices into _S_atoms_out.
+    enum
+      {
+	_S_ominus,
+	_S_oplus,
+	_S_ox,
+	_S_oX,
+	_S_odigits,
+	_S_odigits_end = _S_odigits + 16,
+	_S_oudigits = _S_odigits_end,
+	_S_oudigits_end = _S_oudigits + 16,
+	_S_oe = _S_odigits + 14,  // For scientific notation, 'e'
+	_S_oE = _S_oudigits + 14, // For scientific notation, 'E'
+	_S_oend = _S_oudigits_end
+      };
+
+    // A list of valid numeric literals for output.  This array
+    // contains chars that will be passed through the current locale's
+    // ctype<_CharT>.widen() and then used to render numbers.
+    // For the standard "C" locale, this is
+    // "-+xX0123456789abcdef0123456789ABCDEF".
+    static const char* _S_atoms_out;
+
+    // String literal of acceptable (narrow) input, for num_get.
+    // "-+xX0123456789abcdefABCDEF"
+    static const char* _S_atoms_in;
+
+    enum
+    {
+      _S_iminus,
+      _S_iplus,
+      _S_ix,
+      _S_iX,
+      _S_izero,
+      _S_ie = _S_izero + 14,
+      _S_iE = _S_izero + 20,
+      _S_iend = 26
+    };
+
+    // num_put
+    // Construct and return valid scanf format for floating point types.
+    static void
+    _S_format_float(const ios_base& __io, char* __fptr, char __mod) throw();
+  };
+
+  template<typename _CharT>
+    struct __numpunct_cache : public locale::facet
+    {
+      const char*			_M_grouping;
+      size_t                            _M_grouping_size;
+      bool				_M_use_grouping;
+      const _CharT*			_M_truename;
+      size_t                            _M_truename_size;
+      const _CharT*			_M_falsename;
+      size_t                            _M_falsename_size;
+      _CharT				_M_decimal_point;
+      _CharT				_M_thousands_sep;
+
+      // A list of valid numeric literals for output: in the standard
+      // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
+      // This array contains the chars after having been passed
+      // through the current locale's ctype<_CharT>.widen().
+      _CharT				_M_atoms_out[__num_base::_S_oend];
+
+      // A list of valid numeric literals for input: in the standard
+      // "C" locale, this is "-+xX0123456789abcdefABCDEF"
+      // This array contains the chars after having been passed
+      // through the current locale's ctype<_CharT>.widen().
+      _CharT				_M_atoms_in[__num_base::_S_iend];
+
+      bool				_M_allocated;
+
+      __numpunct_cache(size_t __refs = 0)
+      : facet(__refs), _M_grouping(0), _M_grouping_size(0),
+	_M_use_grouping(false),
+	_M_truename(0), _M_truename_size(0), _M_falsename(0),
+	_M_falsename_size(0), _M_decimal_point(_CharT()),
+	_M_thousands_sep(_CharT()), _M_allocated(false)
+	{ }
+
+      ~__numpunct_cache();
+
+      void
+      _M_cache(const locale& __loc);
+
+    private:
+      __numpunct_cache&
+      operator=(const __numpunct_cache&);
+
+      explicit
+      __numpunct_cache(const __numpunct_cache&);
+    };
+
+  template<typename _CharT>
+    __numpunct_cache<_CharT>::~__numpunct_cache()
+    {
+      if (_M_allocated)
+	{
+	  delete [] _M_grouping;
+	  delete [] _M_truename;
+	  delete [] _M_falsename;
+	}
+    }
+
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+
+  /**
+   *  @brief  Primary class template numpunct.
+   *  @ingroup locales
+   *
+   *  This facet stores several pieces of information related to printing and
+   *  scanning numbers, such as the decimal point character.  It takes a
+   *  template parameter specifying the char type.  The numpunct facet is
+   *  used by streams for many I/O operations involving numbers.
+   *
+   *  The numpunct template uses protected virtual functions to provide the
+   *  actual results.  The public accessors forward the call to the virtual
+   *  functions.  These virtual functions are hooks for developers to
+   *  implement the behavior they require from a numpunct facet.
+  */
+  template<typename _CharT>
+    class numpunct : public locale::facet
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+      //@}
+      typedef __numpunct_cache<_CharT>  __cache_type;
+
+    protected:
+      __cache_type*			_M_data;
+
+    public:
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Numpunct constructor.
+       *
+       *  @param  __refs  Refcount to pass to the base class.
+       */
+      explicit
+      numpunct(size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_numpunct(); }
+
+      /**
+       *  @brief  Internal constructor.  Not for general use.
+       *
+       *  This is a constructor for use by the library itself to set up the
+       *  predefined locale facets.
+       *
+       *  @param  __cache  __numpunct_cache object.
+       *  @param  __refs  Refcount to pass to the base class.
+       */
+      explicit
+      numpunct(__cache_type* __cache, size_t __refs = 0)
+      : facet(__refs), _M_data(__cache)
+      { _M_initialize_numpunct(); }
+
+      /**
+       *  @brief  Internal constructor.  Not for general use.
+       *
+       *  This is a constructor for use by the library itself to set up new
+       *  locales.
+       *
+       *  @param  __cloc  The C locale.
+       *  @param  __refs  Refcount to pass to the base class.
+       */
+      explicit
+      numpunct(__c_locale __cloc, size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_numpunct(__cloc); }
+
+      /**
+       *  @brief  Return decimal point character.
+       *
+       *  This function returns a char_type to use as a decimal point.  It
+       *  does so by returning returning
+       *  numpunct<char_type>::do_decimal_point().
+       *
+       *  @return  @a char_type representing a decimal point.
+      */
+      char_type
+      decimal_point() const
+      { return this->do_decimal_point(); }
+
+      /**
+       *  @brief  Return thousands separator character.
+       *
+       *  This function returns a char_type to use as a thousands
+       *  separator.  It does so by returning returning
+       *  numpunct<char_type>::do_thousands_sep().
+       *
+       *  @return  char_type representing a thousands separator.
+      */
+      char_type
+      thousands_sep() const
+      { return this->do_thousands_sep(); }
+
+      /**
+       *  @brief  Return grouping specification.
+       *
+       *  This function returns a string representing groupings for the
+       *  integer part of a number.  Groupings indicate where thousands
+       *  separators should be inserted in the integer part of a number.
+       *
+       *  Each char in the return string is interpret as an integer
+       *  rather than a character.  These numbers represent the number
+       *  of digits in a group.  The first char in the string
+       *  represents the number of digits in the least significant
+       *  group.  If a char is negative, it indicates an unlimited
+       *  number of digits for the group.  If more chars from the
+       *  string are required to group a number, the last char is used
+       *  repeatedly.
+       *
+       *  For example, if the grouping() returns "\003\002" and is
+       *  applied to the number 123456789, this corresponds to
+       *  12,34,56,789.  Note that if the string was "32", this would
+       *  put more than 50 digits into the least significant group if
+       *  the character set is ASCII.
+       *
+       *  The string is returned by calling
+       *  numpunct<char_type>::do_grouping().
+       *
+       *  @return  string representing grouping specification.
+      */
+      string
+      grouping() const
+      { return this->do_grouping(); }
+
+      /**
+       *  @brief  Return string representation of bool true.
+       *
+       *  This function returns a string_type containing the text
+       *  representation for true bool variables.  It does so by calling
+       *  numpunct<char_type>::do_truename().
+       *
+       *  @return  string_type representing printed form of true.
+      */
+      string_type
+      truename() const
+      { return this->do_truename(); }
+
+      /**
+       *  @brief  Return string representation of bool false.
+       *
+       *  This function returns a string_type containing the text
+       *  representation for false bool variables.  It does so by calling
+       *  numpunct<char_type>::do_falsename().
+       *
+       *  @return  string_type representing printed form of false.
+      */
+      string_type
+      falsename() const
+      { return this->do_falsename(); }
+
+    protected:
+      /// Destructor.
+      virtual
+      ~numpunct();
+
+      /**
+       *  @brief  Return decimal point character.
+       *
+       *  Returns a char_type to use as a decimal point.  This function is a
+       *  hook for derived classes to change the value returned.
+       *
+       *  @return  @a char_type representing a decimal point.
+      */
+      virtual char_type
+      do_decimal_point() const
+      { return _M_data->_M_decimal_point; }
+
+      /**
+       *  @brief  Return thousands separator character.
+       *
+       *  Returns a char_type to use as a thousands separator.  This function
+       *  is a hook for derived classes to change the value returned.
+       *
+       *  @return  @a char_type representing a thousands separator.
+      */
+      virtual char_type
+      do_thousands_sep() const
+      { return _M_data->_M_thousands_sep; }
+
+      /**
+       *  @brief  Return grouping specification.
+       *
+       *  Returns a string representing groupings for the integer part of a
+       *  number.  This function is a hook for derived classes to change the
+       *  value returned.  @see grouping() for details.
+       *
+       *  @return  String representing grouping specification.
+      */
+      virtual string
+      do_grouping() const
+      { return _M_data->_M_grouping; }
+
+      /**
+       *  @brief  Return string representation of bool true.
+       *
+       *  Returns a string_type containing the text representation for true
+       *  bool variables.  This function is a hook for derived classes to
+       *  change the value returned.
+       *
+       *  @return  string_type representing printed form of true.
+      */
+      virtual string_type
+      do_truename() const
+      { return _M_data->_M_truename; }
+
+      /**
+       *  @brief  Return string representation of bool false.
+       *
+       *  Returns a string_type containing the text representation for false
+       *  bool variables.  This function is a hook for derived classes to
+       *  change the value returned.
+       *
+       *  @return  string_type representing printed form of false.
+      */
+      virtual string_type
+      do_falsename() const
+      { return _M_data->_M_falsename; }
+
+      // For use at construction time only.
+      void
+      _M_initialize_numpunct(__c_locale __cloc = 0);
+    };
+
+  template<typename _CharT>
+    locale::id numpunct<_CharT>::id;
+
+  template<>
+    numpunct<char>::~numpunct();
+
+  template<>
+    void
+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    numpunct<wchar_t>::~numpunct();
+
+  template<>
+    void
+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
+#endif
+
+  /// class numpunct_byname [22.2.3.2].
+  template<typename _CharT>
+    class numpunct_byname : public numpunct<_CharT>
+    {
+    public:
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+
+      explicit
+      numpunct_byname(const char* __s, size_t __refs = 0)
+      : numpunct<_CharT>(__refs)
+      {
+	if (__builtin_strcmp(__s, "C") != 0
+	    && __builtin_strcmp(__s, "POSIX") != 0)
+	  {
+	    __c_locale __tmp;
+	    this->_S_create_c_locale(__tmp, __s);
+	    this->_M_initialize_numpunct(__tmp);
+	    this->_S_destroy_c_locale(__tmp);
+	  }
+      }
+
+#if __cplusplus >= 201103L
+      explicit
+      numpunct_byname(const string& __s, size_t __refs = 0)
+      : numpunct_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~numpunct_byname() { }
+    };
+
+_GLIBCXX_END_NAMESPACE_CXX11
+
+_GLIBCXX_BEGIN_NAMESPACE_LDBL
+
+  /**
+   *  @brief  Primary class template num_get.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to parse and return a number
+   *  from a string.  It is used by the istream numeric extraction
+   *  operators.
+   *
+   *  The num_get template uses protected virtual functions to provide the
+   *  actual results.  The public accessors forward the call to the virtual
+   *  functions.  These virtual functions are hooks for developers to
+   *  implement the behavior they require from the num_get facet.
+  */
+  template<typename _CharT, typename _InIter>
+    class num_get : public locale::facet
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef _InIter			iter_type;
+      //@}
+
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      num_get(size_t __refs = 0) : facet(__refs) { }
+
+      /**
+       *  @brief  Numeric parsing.
+       *
+       *  Parses the input stream into the bool @a v.  It does so by calling
+       *  num_get::do_get().
+       *
+       *  If ios_base::boolalpha is set, attempts to read
+       *  ctype<CharT>::truename() or ctype<CharT>::falsename().  Sets
+       *  @a v to true or false if successful.  Sets err to
+       *  ios_base::failbit if reading the string fails.  Sets err to
+       *  ios_base::eofbit if the stream is emptied.
+       *
+       *  If ios_base::boolalpha is not set, proceeds as with reading a long,
+       *  except if the value is 1, sets @a v to true, if the value is 0, sets
+       *  @a v to false, and otherwise set err to ios_base::failbit.
+       *
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after reading.
+      */
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, bool& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      //@{
+      /**
+       *  @brief  Numeric parsing.
+       *
+       *  Parses the input stream into the integral variable @a v.  It does so
+       *  by calling num_get::do_get().
+       *
+       *  Parsing is affected by the flag settings in @a io.
+       *
+       *  The basic parse is affected by the value of io.flags() &
+       *  ios_base::basefield.  If equal to ios_base::oct, parses like the
+       *  scanf %o specifier.  Else if equal to ios_base::hex, parses like %X
+       *  specifier.  Else if basefield equal to 0, parses like the %i
+       *  specifier.  Otherwise, parses like %d for signed and %u for unsigned
+       *  types.  The matching type length modifier is also used.
+       *
+       *  Digit grouping is interpreted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().  If the
+       *  pattern of digit groups isn't consistent, sets err to
+       *  ios_base::failbit.
+       *
+       *  If parsing the string yields a valid value for @a v, @a v is set.
+       *  Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+       *  Sets err to ios_base::eofbit if the stream is emptied.
+       *
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after reading.
+      */
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, unsigned short& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, unsigned int& __v)   const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, unsigned long& __v)  const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, long long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, unsigned long long& __v)  const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+#endif
+      //@}
+
+      //@{
+      /**
+       *  @brief  Numeric parsing.
+       *
+       *  Parses the input stream into the integral variable @a v.  It does so
+       *  by calling num_get::do_get().
+       *
+       *  The input characters are parsed like the scanf %g specifier.  The
+       *  matching type length modifier is also used.
+       *
+       *  The decimal point character used is numpunct::decimal_point().
+       *  Digit grouping is interpreted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().  If the
+       *  pattern of digit groups isn't consistent, sets err to
+       *  ios_base::failbit.
+       *
+       *  If parsing the string yields a valid value for @a v, @a v is set.
+       *  Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+       *  Sets err to ios_base::eofbit if the stream is emptied.
+       *
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after reading.
+      */
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, float& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, double& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, long double& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      //@}
+
+      /**
+       *  @brief  Numeric parsing.
+       *
+       *  Parses the input stream into the pointer variable @a v.  It does so
+       *  by calling num_get::do_get().
+       *
+       *  The input characters are parsed like the scanf %p specifier.
+       *
+       *  Digit grouping is interpreted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().  If the
+       *  pattern of digit groups isn't consistent, sets err to
+       *  ios_base::failbit.
+       *
+       *  Note that the digit grouping effect for pointers is a bit ambiguous
+       *  in the standard and shouldn't be relied on.  See DR 344.
+       *
+       *  If parsing the string yields a valid value for @a v, @a v is set.
+       *  Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+       *  Sets err to ios_base::eofbit if the stream is emptied.
+       *
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after reading.
+      */
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+	  ios_base::iostate& __err, void*& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+    protected:
+      /// Destructor.
+      virtual ~num_get() { }
+
+      _GLIBCXX_DEFAULT_ABI_TAG
+      iter_type
+      _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
+		       string&) const;
+
+      template<typename _ValueT>
+	_GLIBCXX_DEFAULT_ABI_TAG
+	iter_type
+	_M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+		       _ValueT&) const;
+
+      template<typename _CharT2>
+      typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
+	_M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+	{
+	  int __ret = -1;
+	  if (__len <= 10)
+	    {
+	      if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
+		__ret = __c - _CharT2('0');
+	    }
+	  else
+	    {
+	      if (__c >= _CharT2('0') && __c <= _CharT2('9'))
+		__ret = __c - _CharT2('0');
+	      else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
+		__ret = 10 + (__c - _CharT2('a'));
+	      else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
+		__ret = 10 + (__c - _CharT2('A'));
+	    }
+	  return __ret;
+	}
+
+      template<typename _CharT2>
+      typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
+				      int>::__type
+	_M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+	{
+	  int __ret = -1;
+	  const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
+	  if (__q)
+	    {
+	      __ret = __q - __zero;
+	      if (__ret > 15)
+		__ret -= 6;
+	    }
+	  return __ret;
+	}
+
+      //@{
+      /**
+       *  @brief  Numeric parsing.
+       *
+       *  Parses the input stream into the variable @a v.  This function is a
+       *  hook for derived classes to change the value returned.  @see get()
+       *  for more details.
+       *
+       *  @param  __beg  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after reading.
+      */
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, unsigned short& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, unsigned int& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, unsigned long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, long long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, unsigned long long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+#endif
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, float&) const;
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+	     double&) const;
+
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+      virtual iter_type
+      __do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+	       double&) const;
+#else
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+	     long double&) const;
+#endif
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, void*&) const;
+
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+	     long double&) const;
+#endif
+      //@}
+    };
+
+  template<typename _CharT, typename _InIter>
+    locale::id num_get<_CharT, _InIter>::id;
+
+
+  /**
+   *  @brief  Primary class template num_put.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to convert a number to a string.  It is
+   *  used by the ostream numeric insertion operators.
+   *
+   *  The num_put template uses protected virtual functions to provide the
+   *  actual results.  The public accessors forward the call to the virtual
+   *  functions.  These virtual functions are hooks for developers to
+   *  implement the behavior they require from the num_put facet.
+  */
+  template<typename _CharT, typename _OutIter>
+    class num_put : public locale::facet
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT		char_type;
+      typedef _OutIter		iter_type;
+      //@}
+
+      /// Numpunct facet id.
+      static locale::id		id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      num_put(size_t __refs = 0) : facet(__refs) { }
+
+      /**
+       *  @brief  Numeric formatting.
+       *
+       *  Formats the boolean @a v and inserts it into a stream.  It does so
+       *  by calling num_put::do_put().
+       *
+       *  If ios_base::boolalpha is set, writes ctype<CharT>::truename() or
+       *  ctype<CharT>::falsename().  Otherwise formats @a v as an int.
+       *
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after writing.
+      */
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      //@{
+      /**
+       *  @brief  Numeric formatting.
+       *
+       *  Formats the integral value @a v and inserts it into a
+       *  stream.  It does so by calling num_put::do_put().
+       *
+       *  Formatting is affected by the flag settings in @a io.
+       *
+       *  The basic format is affected by the value of io.flags() &
+       *  ios_base::basefield.  If equal to ios_base::oct, formats like the
+       *  printf %o specifier.  Else if equal to ios_base::hex, formats like
+       *  %x or %X with ios_base::uppercase unset or set respectively.
+       *  Otherwise, formats like %d, %ld, %lld for signed and %u, %lu, %llu
+       *  for unsigned values.  Note that if both oct and hex are set, neither
+       *  will take effect.
+       *
+       *  If ios_base::showpos is set, '+' is output before positive values.
+       *  If ios_base::showbase is set, '0' precedes octal values (except 0)
+       *  and '0[xX]' precedes hex values.
+       *
+       *  The decimal point character used is numpunct::decimal_point().
+       *  Thousands separators are inserted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().
+       *
+       *  If io.width() is non-zero, enough @a fill characters are inserted to
+       *  make the result at least that wide.  If
+       *  (io.flags() & ios_base::adjustfield) == ios_base::left, result is
+       *  padded at the end.  If ios_base::internal, then padding occurs
+       *  immediately after either a '+' or '-' or after '0x' or '0X'.
+       *  Otherwise, padding occurs at the beginning.
+       *
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after writing.
+      */
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+	  unsigned long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+	  unsigned long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+#endif
+      //@}
+
+      //@{
+      /**
+       *  @brief  Numeric formatting.
+       *
+       *  Formats the floating point value @a v and inserts it into a stream.
+       *  It does so by calling num_put::do_put().
+       *
+       *  Formatting is affected by the flag settings in @a io.
+       *
+       *  The basic format is affected by the value of io.flags() &
+       *  ios_base::floatfield.  If equal to ios_base::fixed, formats like the
+       *  printf %f specifier.  Else if equal to ios_base::scientific, formats
+       *  like %e or %E with ios_base::uppercase unset or set respectively.
+       *  Otherwise, formats like %g or %G depending on uppercase.  Note that
+       *  if both fixed and scientific are set, the effect will also be like
+       *  %g or %G.
+       *
+       *  The output precision is given by io.precision().  This precision is
+       *  capped at numeric_limits::digits10 + 2 (different for double and
+       *  long double).  The default precision is 6.
+       *
+       *  If ios_base::showpos is set, '+' is output before positive values.
+       *  If ios_base::showpoint is set, a decimal point will always be
+       *  output.
+       *
+       *  The decimal point character used is numpunct::decimal_point().
+       *  Thousands separators are inserted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().
+       *
+       *  If io.width() is non-zero, enough @a fill characters are inserted to
+       *  make the result at least that wide.  If
+       *  (io.flags() & ios_base::adjustfield) == ios_base::left, result is
+       *  padded at the end.  If ios_base::internal, then padding occurs
+       *  immediately after either a '+' or '-' or after '0x' or '0X'.
+       *  Otherwise, padding occurs at the beginning.
+       *
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after writing.
+      */
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+	  long double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      //@}
+
+      /**
+       *  @brief  Numeric formatting.
+       *
+       *  Formats the pointer value @a v and inserts it into a stream.  It
+       *  does so by calling num_put::do_put().
+       *
+       *  This function formats @a v as an unsigned long with ios_base::hex
+       *  and ios_base::showbase set.
+       *
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after writing.
+      */
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+	  const void* __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+    protected:
+      template<typename _ValueT>
+	iter_type
+	_M_insert_float(iter_type, ios_base& __io, char_type __fill,
+			char __mod, _ValueT __v) const;
+
+      void
+      _M_group_float(const char* __grouping, size_t __grouping_size,
+		     char_type __sep, const char_type* __p, char_type* __new,
+		     char_type* __cs, int& __len) const;
+
+      template<typename _ValueT>
+	iter_type
+	_M_insert_int(iter_type, ios_base& __io, char_type __fill,
+		      _ValueT __v) const;
+
+      void
+      _M_group_int(const char* __grouping, size_t __grouping_size,
+		   char_type __sep, ios_base& __io, char_type* __new,
+		   char_type* __cs, int& __len) const;
+
+      void
+      _M_pad(char_type __fill, streamsize __w, ios_base& __io,
+	     char_type* __new, const char_type* __cs, int& __len) const;
+
+      /// Destructor.
+      virtual
+      ~num_put() { };
+
+      //@{
+      /**
+       *  @brief  Numeric formatting.
+       *
+       *  These functions do the work of formatting numeric values and
+       *  inserting them into a stream. This function is a hook for derived
+       *  classes to change the value returned.
+       *
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
+       *  @return  Iterator after writing.
+      */
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const;
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+	     unsigned long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+	     long long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+	     unsigned long long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+#endif
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, double) const;
+
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+      virtual iter_type
+      __do_put(iter_type, ios_base&, char_type, double) const;
+#else
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, long double) const;
+#endif
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, const void*) const;
+
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, long double) const;
+#endif
+      //@}
+    };
+
+  template <typename _CharT, typename _OutIter>
+    locale::id num_put<_CharT, _OutIter>::id;
+
+_GLIBCXX_END_NAMESPACE_LDBL
+
+  // Subclause convenience interfaces, inlines.
+  // NB: These are inline because, when used in a loop, some compilers
+  // can hoist the body out of the loop; then it's just as fast as the
+  // C is*() function.
+
+  /// Convenience interface to ctype.is(ctype_base::space, __c).
+  template<typename _CharT>
+    inline bool
+    isspace(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::print, __c).
+  template<typename _CharT>
+    inline bool
+    isprint(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::cntrl, __c).
+  template<typename _CharT>
+    inline bool
+    iscntrl(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::upper, __c).
+  template<typename _CharT>
+    inline bool
+    isupper(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::lower, __c).
+  template<typename _CharT>
+    inline bool
+    islower(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::alpha, __c).
+  template<typename _CharT>
+    inline bool
+    isalpha(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::digit, __c).
+  template<typename _CharT>
+    inline bool
+    isdigit(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::punct, __c).
+  template<typename _CharT>
+    inline bool
+    ispunct(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::xdigit, __c).
+  template<typename _CharT>
+    inline bool
+    isxdigit(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::alnum, __c).
+  template<typename _CharT>
+    inline bool
+    isalnum(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
+
+  /// Convenience interface to ctype.is(ctype_base::graph, __c).
+  template<typename _CharT>
+    inline bool
+    isgraph(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
+
+#if __cplusplus >= 201103L
+  /// Convenience interface to ctype.is(ctype_base::blank, __c).
+  template<typename _CharT>
+    inline bool
+    isblank(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c); }
+#endif
+
+  /// Convenience interface to ctype.toupper(__c).
+  template<typename _CharT>
+    inline _CharT
+    toupper(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
+
+  /// Convenience interface to ctype.tolower(__c).
+  template<typename _CharT>
+    inline _CharT
+    tolower(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+# include <bits/locale_facets.tcc>
+
+#endif

+ 1377 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets.tcc

@@ -0,0 +1,1377 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_facets.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+#ifndef _LOCALE_FACETS_TCC
+#define _LOCALE_FACETS_TCC 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Routine to access a cache for the facet.  If the cache didn't
+  // exist before, it gets constructed on the fly.
+  template<typename _Facet>
+    struct __use_cache
+    {
+      const _Facet*
+      operator() (const locale& __loc) const;
+    };
+
+  // Specializations.
+  template<typename _CharT>
+    struct __use_cache<__numpunct_cache<_CharT> >
+    {
+      const __numpunct_cache<_CharT>*
+      operator() (const locale& __loc) const
+      {
+	const size_t __i = numpunct<_CharT>::id._M_id();
+	const locale::facet** __caches = __loc._M_impl->_M_caches;
+	if (!__caches[__i])
+	  {
+	    __numpunct_cache<_CharT>* __tmp = 0;
+	    __try
+	      {
+		__tmp = new __numpunct_cache<_CharT>;
+		__tmp->_M_cache(__loc);
+	      }
+	    __catch(...)
+	      {
+		delete __tmp;
+		__throw_exception_again;
+	      }
+	    __loc._M_impl->_M_install_cache(__tmp, __i);
+	  }
+	return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+      }
+    };
+
+  template<typename _CharT>
+    void
+    __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+    {
+      const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+
+      char* __grouping = 0;
+      _CharT* __truename = 0;
+      _CharT* __falsename = 0;
+      __try
+	{
+	  const string& __g = __np.grouping();
+	  _M_grouping_size = __g.size();
+	  __grouping = new char[_M_grouping_size];
+	  __g.copy(__grouping, _M_grouping_size);
+	  _M_use_grouping = (_M_grouping_size
+			     && static_cast<signed char>(__grouping[0]) > 0
+			     && (__grouping[0]
+				 != __gnu_cxx::__numeric_traits<char>::__max));
+
+	  const basic_string<_CharT>& __tn = __np.truename();
+	  _M_truename_size = __tn.size();
+	  __truename = new _CharT[_M_truename_size];
+	  __tn.copy(__truename, _M_truename_size);
+
+	  const basic_string<_CharT>& __fn = __np.falsename();
+	  _M_falsename_size = __fn.size();
+	  __falsename = new _CharT[_M_falsename_size];
+	  __fn.copy(__falsename, _M_falsename_size);
+
+	  _M_decimal_point = __np.decimal_point();
+	  _M_thousands_sep = __np.thousands_sep();
+
+	  const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+	  __ct.widen(__num_base::_S_atoms_out,
+		     __num_base::_S_atoms_out
+		     + __num_base::_S_oend, _M_atoms_out);
+	  __ct.widen(__num_base::_S_atoms_in,
+		     __num_base::_S_atoms_in
+		     + __num_base::_S_iend, _M_atoms_in);
+
+	  _M_grouping = __grouping;
+	  _M_truename = __truename;
+	  _M_falsename = __falsename;
+	  _M_allocated = true;
+	}
+      __catch(...)
+	{
+	  delete [] __grouping;
+	  delete [] __truename;
+	  delete [] __falsename;
+	  __throw_exception_again;
+	}
+    }
+
+  // Used by both numeric and monetary facets.
+  // Check to make sure that the __grouping_tmp string constructed in
+  // money_get or num_get matches the canonical grouping for a given
+  // locale.
+  // __grouping_tmp is parsed L to R
+  // 1,222,444 == __grouping_tmp of "\1\3\3"
+  // __grouping is parsed R to L
+  // 1,222,444 == __grouping of "\3" == "\3\3\3"
+  _GLIBCXX_PURE bool
+  __verify_grouping(const char* __grouping, size_t __grouping_size,
+		    const string& __grouping_tmp) throw ();
+
+_GLIBCXX_BEGIN_NAMESPACE_LDBL
+
+  template<typename _CharT, typename _InIter>
+    _GLIBCXX_DEFAULT_ABI_TAG
+    _InIter
+    num_get<_CharT, _InIter>::
+    _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
+		     ios_base::iostate& __err, string& __xtrc) const
+    {
+      typedef char_traits<_CharT>			__traits_type;
+      typedef __numpunct_cache<_CharT>                  __cache_type;
+      __use_cache<__cache_type> __uc;
+      const locale& __loc = __io._M_getloc();
+      const __cache_type* __lc = __uc(__loc);
+      const _CharT* __lit = __lc->_M_atoms_in;
+      char_type __c = char_type();
+
+      // True if __beg becomes equal to __end.
+      bool __testeof = __beg == __end;
+
+      // First check for sign.
+      if (!__testeof)
+	{
+	  __c = *__beg;
+	  const bool __plus = __c == __lit[__num_base::_S_iplus];
+	  if ((__plus || __c == __lit[__num_base::_S_iminus])
+	      && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+	      && !(__c == __lc->_M_decimal_point))
+	    {
+	      __xtrc += __plus ? '+' : '-';
+	      if (++__beg != __end)
+		__c = *__beg;
+	      else
+		__testeof = true;
+	    }
+	}
+
+      // Next, look for leading zeros.
+      bool __found_mantissa = false;
+      int __sep_pos = 0;
+      while (!__testeof)
+	{
+	  if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+	      || __c == __lc->_M_decimal_point)
+	    break;
+	  else if (__c == __lit[__num_base::_S_izero])
+	    {
+	      if (!__found_mantissa)
+		{
+		  __xtrc += '0';
+		  __found_mantissa = true;
+		}
+	      ++__sep_pos;
+
+	      if (++__beg != __end)
+		__c = *__beg;
+	      else
+		__testeof = true;
+	    }
+	  else
+	    break;
+	}
+
+      // Only need acceptable digits for floating point numbers.
+      bool __found_dec = false;
+      bool __found_sci = false;
+      string __found_grouping;
+      if (__lc->_M_use_grouping)
+	__found_grouping.reserve(32);
+      const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+      if (!__lc->_M_allocated)
+	// "C" locale
+	while (!__testeof)
+	  {
+	    const int __digit = _M_find(__lit_zero, 10, __c);
+	    if (__digit != -1)
+	      {
+		__xtrc += '0' + __digit;
+		__found_mantissa = true;
+	      }
+	    else if (__c == __lc->_M_decimal_point
+		     && !__found_dec && !__found_sci)
+	      {
+		__xtrc += '.';
+		__found_dec = true;
+	      }
+	    else if ((__c == __lit[__num_base::_S_ie] 
+		      || __c == __lit[__num_base::_S_iE])
+		     && !__found_sci && __found_mantissa)
+	      {
+		// Scientific notation.
+		__xtrc += 'e';
+		__found_sci = true;
+		
+		// Remove optional plus or minus sign, if they exist.
+		if (++__beg != __end)
+		  {
+		    __c = *__beg;
+		    const bool __plus = __c == __lit[__num_base::_S_iplus];
+		    if (__plus || __c == __lit[__num_base::_S_iminus])
+		      __xtrc += __plus ? '+' : '-';
+		    else
+		      continue;
+		  }
+		else
+		  {
+		    __testeof = true;
+		    break;
+		  }
+	      }
+	    else
+	      break;
+
+	    if (++__beg != __end)
+	      __c = *__beg;
+	    else
+	      __testeof = true;
+	  }
+      else
+	while (!__testeof)
+	  {
+	    // According to 22.2.2.1.2, p8-9, first look for thousands_sep
+	    // and decimal_point.
+	    if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+	      {
+		if (!__found_dec && !__found_sci)
+		  {
+		    // NB: Thousands separator at the beginning of a string
+		    // is a no-no, as is two consecutive thousands separators.
+		    if (__sep_pos)
+		      {
+			__found_grouping += static_cast<char>(__sep_pos);
+			__sep_pos = 0;
+		      }
+		    else
+		      {
+			// NB: __convert_to_v will not assign __v and will
+			// set the failbit.
+			__xtrc.clear();
+			break;
+		      }
+		  }
+		else
+		  break;
+	      }
+	    else if (__c == __lc->_M_decimal_point)
+	      {
+		if (!__found_dec && !__found_sci)
+		  {
+		    // If no grouping chars are seen, no grouping check
+		    // is applied. Therefore __found_grouping is adjusted
+		    // only if decimal_point comes after some thousands_sep.
+		    if (__found_grouping.size())
+		      __found_grouping += static_cast<char>(__sep_pos);
+		    __xtrc += '.';
+		    __found_dec = true;
+		  }
+		else
+		  break;
+	      }
+	    else
+	      {
+		const char_type* __q =
+		  __traits_type::find(__lit_zero, 10, __c);
+		if (__q)
+		  {
+		    __xtrc += '0' + (__q - __lit_zero);
+		    __found_mantissa = true;
+		    ++__sep_pos;
+		  }
+		else if ((__c == __lit[__num_base::_S_ie] 
+			  || __c == __lit[__num_base::_S_iE])
+			 && !__found_sci && __found_mantissa)
+		  {
+		    // Scientific notation.
+		    if (__found_grouping.size() && !__found_dec)
+		      __found_grouping += static_cast<char>(__sep_pos);
+		    __xtrc += 'e';
+		    __found_sci = true;
+		    
+		    // Remove optional plus or minus sign, if they exist.
+		    if (++__beg != __end)
+		      {
+			__c = *__beg;
+			const bool __plus = __c == __lit[__num_base::_S_iplus];
+			if ((__plus || __c == __lit[__num_base::_S_iminus])
+			    && !(__lc->_M_use_grouping
+				 && __c == __lc->_M_thousands_sep)
+			    && !(__c == __lc->_M_decimal_point))
+		      __xtrc += __plus ? '+' : '-';
+			else
+			  continue;
+		      }
+		    else
+		      {
+			__testeof = true;
+			break;
+		      }
+		  }
+		else
+		  break;
+	      }
+	    
+	    if (++__beg != __end)
+	      __c = *__beg;
+	    else
+	      __testeof = true;
+	  }
+
+      // Digit grouping is checked. If grouping and found_grouping don't
+      // match, then get very very upset, and set failbit.
+      if (__found_grouping.size())
+        {
+          // Add the ending grouping if a decimal or 'e'/'E' wasn't found.
+	  if (!__found_dec && !__found_sci)
+	    __found_grouping += static_cast<char>(__sep_pos);
+
+          if (!std::__verify_grouping(__lc->_M_grouping, 
+				      __lc->_M_grouping_size,
+				      __found_grouping))
+	    __err = ios_base::failbit;
+        }
+
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    template<typename _ValueT>
+      _GLIBCXX_DEFAULT_ABI_TAG
+      _InIter
+      num_get<_CharT, _InIter>::
+      _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+		     ios_base::iostate& __err, _ValueT& __v) const
+      {
+        typedef char_traits<_CharT>			     __traits_type;
+	using __gnu_cxx::__add_unsigned;
+	typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+	typedef __numpunct_cache<_CharT>                     __cache_type;
+	__use_cache<__cache_type> __uc;
+	const locale& __loc = __io._M_getloc();
+	const __cache_type* __lc = __uc(__loc);
+	const _CharT* __lit = __lc->_M_atoms_in;
+	char_type __c = char_type();
+
+	// NB: Iff __basefield == 0, __base can change based on contents.
+	const ios_base::fmtflags __basefield = __io.flags()
+	                                       & ios_base::basefield;
+	const bool __oct = __basefield == ios_base::oct;
+	int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+
+	// True if __beg becomes equal to __end.
+	bool __testeof = __beg == __end;
+
+	// First check for sign.
+	bool __negative = false;
+	if (!__testeof)
+	  {
+	    __c = *__beg;
+	    __negative = __c == __lit[__num_base::_S_iminus];
+	    if ((__negative || __c == __lit[__num_base::_S_iplus])
+		&& !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+		&& !(__c == __lc->_M_decimal_point))
+	      {
+		if (++__beg != __end)
+		  __c = *__beg;
+		else
+		  __testeof = true;
+	      }
+	  }
+
+	// Next, look for leading zeros and check required digits
+	// for base formats.
+	bool __found_zero = false;
+	int __sep_pos = 0;
+	while (!__testeof)
+	  {
+	    if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+		|| __c == __lc->_M_decimal_point)
+	      break;
+	    else if (__c == __lit[__num_base::_S_izero] 
+		     && (!__found_zero || __base == 10))
+	      {
+		__found_zero = true;
+		++__sep_pos;
+		if (__basefield == 0)
+		  __base = 8;
+		if (__base == 8)
+		  __sep_pos = 0;
+	      }
+	    else if (__found_zero
+		     && (__c == __lit[__num_base::_S_ix]
+			 || __c == __lit[__num_base::_S_iX]))
+	      {
+		if (__basefield == 0)
+		  __base = 16;
+		if (__base == 16)
+		  {
+		    __found_zero = false;
+		    __sep_pos = 0;
+		  }
+		else
+		  break;
+	      }
+	    else
+	      break;
+
+	    if (++__beg != __end)
+	      {
+		__c = *__beg;
+		if (!__found_zero)
+		  break;
+	      }
+	    else
+	      __testeof = true;
+	  }
+	
+	// At this point, base is determined. If not hex, only allow
+	// base digits as valid input.
+	const size_t __len = (__base == 16 ? __num_base::_S_iend
+			      - __num_base::_S_izero : __base);
+
+	// Extract.
+	string __found_grouping;
+	if (__lc->_M_use_grouping)
+	  __found_grouping.reserve(32);
+	bool __testfail = false;
+	bool __testoverflow = false;
+	const __unsigned_type __max =
+	  (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+	  ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
+	  : __gnu_cxx::__numeric_traits<_ValueT>::__max;
+	const __unsigned_type __smax = __max / __base;
+	__unsigned_type __result = 0;
+	int __digit = 0;
+	const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+	if (!__lc->_M_allocated)
+	  // "C" locale
+	  while (!__testeof)
+	    {
+	      __digit = _M_find(__lit_zero, __len, __c);
+	      if (__digit == -1)
+		break;
+	      
+	      if (__result > __smax)
+		__testoverflow = true;
+	      else
+		{
+		  __result *= __base;
+		  __testoverflow |= __result > __max - __digit;
+		  __result += __digit;
+		  ++__sep_pos;
+		}
+	      
+	      if (++__beg != __end)
+		__c = *__beg;
+	      else
+		__testeof = true;
+	    }
+	else
+	  while (!__testeof)
+	    {
+	      // According to 22.2.2.1.2, p8-9, first look for thousands_sep
+	      // and decimal_point.
+	      if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+		{
+		  // NB: Thousands separator at the beginning of a string
+		  // is a no-no, as is two consecutive thousands separators.
+		  if (__sep_pos)
+		    {
+		      __found_grouping += static_cast<char>(__sep_pos);
+		      __sep_pos = 0;
+		    }
+		  else
+		    {
+		      __testfail = true;
+		      break;
+		    }
+		}
+	      else if (__c == __lc->_M_decimal_point)
+		break;
+	      else
+		{
+		  const char_type* __q =
+		    __traits_type::find(__lit_zero, __len, __c);
+		  if (!__q)
+		    break;
+		  
+		  __digit = __q - __lit_zero;
+		  if (__digit > 15)
+		    __digit -= 6;
+		  if (__result > __smax)
+		    __testoverflow = true;
+		  else
+		    {
+		      __result *= __base;
+		      __testoverflow |= __result > __max - __digit;
+		      __result += __digit;
+		      ++__sep_pos;
+		    }
+		}
+	      
+	      if (++__beg != __end)
+		__c = *__beg;
+	      else
+		__testeof = true;
+	    }
+	
+	// Digit grouping is checked. If grouping and found_grouping don't
+	// match, then get very very upset, and set failbit.
+	if (__found_grouping.size())
+	  {
+	    // Add the ending grouping.
+	    __found_grouping += static_cast<char>(__sep_pos);
+
+	    if (!std::__verify_grouping(__lc->_M_grouping,
+					__lc->_M_grouping_size,
+					__found_grouping))
+	      __err = ios_base::failbit;
+	  }
+
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
+	// 23. Num_get overflow result.
+	if ((!__sep_pos && !__found_zero && !__found_grouping.size())
+	    || __testfail)
+	  {
+	    __v = 0;
+	    __err = ios_base::failbit;
+	  }
+	else if (__testoverflow)
+	  {
+	    if (__negative
+		&& __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+	      __v = __gnu_cxx::__numeric_traits<_ValueT>::__min;
+	    else
+	      __v = __gnu_cxx::__numeric_traits<_ValueT>::__max;
+	    __err = ios_base::failbit;
+	  }
+	else
+	  __v = __negative ? -__result : __result;
+
+	if (__testeof)
+	  __err |= ios_base::eofbit;
+	return __beg;
+      }
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 17.  Bad bool parsing
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, bool& __v) const
+    {
+      if (!(__io.flags() & ios_base::boolalpha))
+        {
+	  // Parse bool values as long.
+          // NB: We can't just call do_get(long) here, as it might
+          // refer to a derived class.
+	  long __l = -1;
+          __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+	  if (__l == 0 || __l == 1)
+	    __v = bool(__l);
+	  else
+	    {
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 23. Num_get overflow result.
+	      __v = true;
+	      __err = ios_base::failbit;
+	      if (__beg == __end)
+		__err |= ios_base::eofbit;
+	    }
+        }
+      else
+        {
+	  // Parse bool values as alphanumeric.
+	  typedef __numpunct_cache<_CharT>  __cache_type;
+	  __use_cache<__cache_type> __uc;
+	  const locale& __loc = __io._M_getloc();
+	  const __cache_type* __lc = __uc(__loc);
+
+	  bool __testf = true;
+	  bool __testt = true;
+	  bool __donef = __lc->_M_falsename_size == 0;
+	  bool __donet = __lc->_M_truename_size == 0;
+	  bool __testeof = false;
+	  size_t __n = 0;
+	  while (!__donef || !__donet)
+	    {
+	      if (__beg == __end)
+		{
+		  __testeof = true;
+		  break;
+		}
+
+	      const char_type __c = *__beg;
+
+	      if (!__donef)
+		__testf = __c == __lc->_M_falsename[__n];
+
+	      if (!__testf && __donet)
+		break;
+
+	      if (!__donet)
+		__testt = __c == __lc->_M_truename[__n];
+
+	      if (!__testt && __donef)
+		break;
+
+	      if (!__testt && !__testf)
+		break;
+
+	      ++__n;
+	      ++__beg;
+
+	      __donef = !__testf || __n >= __lc->_M_falsename_size;
+	      __donet = !__testt || __n >= __lc->_M_truename_size;
+	    }
+	  if (__testf && __n == __lc->_M_falsename_size && __n)
+	    {
+	      __v = false;
+	      if (__testt && __n == __lc->_M_truename_size)
+		__err = ios_base::failbit;
+	      else
+		__err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+	    }
+	  else if (__testt && __n == __lc->_M_truename_size && __n)
+	    {
+	      __v = true;
+	      __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+	    }
+	  else
+	    {
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 23. Num_get overflow result.
+	      __v = false;
+	      __err = ios_base::failbit;
+	      if (__testeof)
+		__err |= ios_base::eofbit;
+	    }
+	}
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	   ios_base::iostate& __err, float& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    __do_get(iter_type __beg, iter_type __end, ios_base& __io,
+	     ios_base::iostate& __err, double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+#endif
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, long double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, void*& __v) const
+    {
+      // Prepare for hex formatted input.
+      typedef ios_base::fmtflags        fmtflags;
+      const fmtflags __fmt = __io.flags();
+      __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
+
+      typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+					     <= sizeof(unsigned long)),
+	unsigned long, unsigned long long>::__type _UIntPtrType;       
+
+      _UIntPtrType __ul;
+      __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
+
+      // Reset from hex formatted input.
+      __io.flags(__fmt);
+
+      __v = reinterpret_cast<void*>(__ul);
+      return __beg;
+    }
+
+  // For use by integer and floating-point types after they have been
+  // converted into a char_type string.
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
+	   _CharT* __new, const _CharT* __cs, int& __len) const
+    {
+      // [22.2.2.2.2] Stage 3.
+      // If necessary, pad.
+      __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
+						  __cs, __w, __len);
+      __len = static_cast<int>(__w);
+    }
+
+_GLIBCXX_END_NAMESPACE_LDBL
+
+  template<typename _CharT, typename _ValueT>
+    int
+    __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+		  ios_base::fmtflags __flags, bool __dec)
+    {
+      _CharT* __buf = __bufend;
+      if (__builtin_expect(__dec, true))
+	{
+	  // Decimal.
+	  do
+	    {
+	      *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
+	      __v /= 10;
+	    }
+	  while (__v != 0);
+	}
+      else if ((__flags & ios_base::basefield) == ios_base::oct)
+	{
+	  // Octal.
+	  do
+	    {
+	      *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
+	      __v >>= 3;
+	    }
+	  while (__v != 0);
+	}
+      else
+	{
+	  // Hex.
+	  const bool __uppercase = __flags & ios_base::uppercase;
+	  const int __case_offset = __uppercase ? __num_base::_S_oudigits
+	                                        : __num_base::_S_odigits;
+	  do
+	    {
+	      *--__buf = __lit[(__v & 0xf) + __case_offset];
+	      __v >>= 4;
+	    }
+	  while (__v != 0);
+	}
+      return __bufend - __buf;
+    }
+
+_GLIBCXX_BEGIN_NAMESPACE_LDBL
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
+		 ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
+    {
+      _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
+					__grouping_size, __cs, __cs + __len);
+      __len = __p - __new;
+    }
+  
+  template<typename _CharT, typename _OutIter>
+    template<typename _ValueT>
+      _OutIter
+      num_put<_CharT, _OutIter>::
+      _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+		    _ValueT __v) const
+      {
+	using __gnu_cxx::__add_unsigned;
+	typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+	typedef __numpunct_cache<_CharT>	             __cache_type;
+	__use_cache<__cache_type> __uc;
+	const locale& __loc = __io._M_getloc();
+	const __cache_type* __lc = __uc(__loc);
+	const _CharT* __lit = __lc->_M_atoms_out;
+	const ios_base::fmtflags __flags = __io.flags();
+
+	// Long enough to hold hex, dec, and octal representations.
+	const int __ilen = 5 * sizeof(_ValueT);
+	_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+							     * __ilen));
+
+	// [22.2.2.2.2] Stage 1, numeric conversion to character.
+	// Result is returned right-justified in the buffer.
+	const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
+	const bool __dec = (__basefield != ios_base::oct
+			    && __basefield != ios_base::hex);
+	const __unsigned_type __u = ((__v > 0 || !__dec)
+				     ? __unsigned_type(__v)
+				     : -__unsigned_type(__v));
+ 	int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
+	__cs += __ilen - __len;
+
+	// Add grouping, if necessary.
+	if (__lc->_M_use_grouping)
+	  {
+	    // Grouping can add (almost) as many separators as the number
+	    // of digits + space is reserved for numeric base or sign.
+	    _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+								  * (__len + 1)
+								  * 2));
+	    _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
+			 __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
+	    __cs = __cs2 + 2;
+	  }
+
+	// Complete Stage 1, prepend numeric base or sign.
+	if (__builtin_expect(__dec, true))
+	  {
+	    // Decimal.
+	    if (__v >= 0)
+	      {
+		if (bool(__flags & ios_base::showpos)
+		    && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+		  *--__cs = __lit[__num_base::_S_oplus], ++__len;
+	      }
+	    else
+	      *--__cs = __lit[__num_base::_S_ominus], ++__len;
+	  }
+	else if (bool(__flags & ios_base::showbase) && __v)
+	  {
+	    if (__basefield == ios_base::oct)
+	      *--__cs = __lit[__num_base::_S_odigits], ++__len;
+	    else
+	      {
+		// 'x' or 'X'
+		const bool __uppercase = __flags & ios_base::uppercase;
+		*--__cs = __lit[__num_base::_S_ox + __uppercase];
+		// '0'
+		*--__cs = __lit[__num_base::_S_odigits];
+		__len += 2;
+	      }
+	  }
+
+	// Pad.
+	const streamsize __w = __io.width();
+	if (__w > static_cast<streamsize>(__len))
+	  {
+	    _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+								  * __w));
+	    _M_pad(__fill, __w, __io, __cs3, __cs, __len);
+	    __cs = __cs3;
+	  }
+	__io.width(0);
+
+	// [22.2.2.2.2] Stage 4.
+	// Write resulting, fully-formatted string to output iterator.
+	return std::__write(__s, __cs, __len);
+      }
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_group_float(const char* __grouping, size_t __grouping_size,
+		   _CharT __sep, const _CharT* __p, _CharT* __new,
+		   _CharT* __cs, int& __len) const
+    {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 282. What types does numpunct grouping refer to?
+      // Add grouping, if necessary.
+      const int __declen = __p ? __p - __cs : __len;
+      _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
+					 __grouping_size,
+					 __cs, __cs + __declen);
+
+      // Tack on decimal part.
+      int __newlen = __p2 - __new;
+      if (__p)
+	{
+	  char_traits<_CharT>::copy(__p2, __p, __len - __declen);
+	  __newlen += __len - __declen;
+	}
+      __len = __newlen;
+    }
+
+  // The following code uses vsnprintf (or vsprintf(), when
+  // _GLIBCXX_USE_C99_STDIO is not defined) to convert floating point
+  // values for insertion into a stream.  An optimization would be to
+  // replace them with code that works directly on a wide buffer and
+  // then use __pad to do the padding.  It would be good to replace
+  // them anyway to gain back the efficiency that C++ provides by
+  // knowing up front the type of the values to insert.  Also, sprintf
+  // is dangerous since may lead to accidental buffer overruns.  This
+  // implementation follows the C++ standard fairly directly as
+  // outlined in 22.2.2.2 [lib.locale.num.put]
+  template<typename _CharT, typename _OutIter>
+    template<typename _ValueT>
+      _OutIter
+      num_put<_CharT, _OutIter>::
+      _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+		       _ValueT __v) const
+      {
+	typedef __numpunct_cache<_CharT>                __cache_type;
+	__use_cache<__cache_type> __uc;
+	const locale& __loc = __io._M_getloc();
+	const __cache_type* __lc = __uc(__loc);
+
+	// Use default precision if out of range.
+	const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
+
+	const int __max_digits =
+	  __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
+
+	// [22.2.2.2.2] Stage 1, numeric conversion to character.
+	int __len;
+	// Long enough for the max format spec.
+	char __fbuf[16];
+	__num_base::_S_format_float(__io, __fbuf, __mod);
+
+#if _GLIBCXX_USE_C99_STDIO
+	// Precision is always used except for hexfloat format.
+	const bool __use_prec =
+	  (__io.flags() & ios_base::floatfield) != ios_base::floatfield;
+
+	// First try a buffer perhaps big enough (most probably sufficient
+	// for non-ios_base::fixed outputs)
+	int __cs_size = __max_digits * 3;
+	char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+	if (__use_prec)
+	  __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+					__fbuf, __prec, __v);
+	else
+	  __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+					__fbuf, __v);
+
+	// If the buffer was not large enough, try again with the correct size.
+	if (__len >= __cs_size)
+	  {
+	    __cs_size = __len + 1;
+	    __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+	    if (__use_prec)
+	      __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+					    __fbuf, __prec, __v);
+	    else
+	      __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+					    __fbuf, __v);
+	  }
+#else
+	// Consider the possibility of long ios_base::fixed outputs
+	const bool __fixed = __io.flags() & ios_base::fixed;
+	const int __max_exp =
+	  __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
+
+	// The size of the output string is computed as follows.
+	// ios_base::fixed outputs may need up to __max_exp + 1 chars
+	// for the integer part + __prec chars for the fractional part
+	// + 3 chars for sign, decimal point, '\0'. On the other hand,
+	// for non-fixed outputs __max_digits * 2 + __prec chars are
+	// largely sufficient.
+	const int __cs_size = __fixed ? __max_exp + __prec + 4
+	                              : __max_digits * 2 + __prec;
+	char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+	__len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf, 
+				      __prec, __v);
+#endif
+
+	// [22.2.2.2.2] Stage 2, convert to char_type, using correct
+	// numpunct.decimal_point() values for '.' and adding grouping.
+	const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+	
+	_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+							     * __len));
+	__ctype.widen(__cs, __cs + __len, __ws);
+	
+	// Replace decimal point.
+	_CharT* __wp = 0;
+	const char* __p = char_traits<char>::find(__cs, __len, '.');
+	if (__p)
+	  {
+	    __wp = __ws + (__p - __cs);
+	    *__wp = __lc->_M_decimal_point;
+	  }
+	
+	// Add grouping, if necessary.
+	// N.B. Make sure to not group things like 2e20, i.e., no decimal
+	// point, scientific notation.
+	if (__lc->_M_use_grouping
+	    && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
+				      && __cs[1] >= '0' && __cs[2] >= '0')))
+	  {
+	    // Grouping can add (almost) as many separators as the
+	    // number of digits, but no more.
+	    _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+								  * __len * 2));
+	    
+	    streamsize __off = 0;
+	    if (__cs[0] == '-' || __cs[0] == '+')
+	      {
+		__off = 1;
+		__ws2[0] = __ws[0];
+		__len -= 1;
+	      }
+	    
+	    _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
+			   __lc->_M_thousands_sep, __wp, __ws2 + __off,
+			   __ws + __off, __len);
+	    __len += __off;
+	    
+	    __ws = __ws2;
+	  }
+
+	// Pad.
+	const streamsize __w = __io.width();
+	if (__w > static_cast<streamsize>(__len))
+	  {
+	    _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+								  * __w));
+	    _M_pad(__fill, __w, __io, __ws3, __ws, __len);
+	    __ws = __ws3;
+	  }
+	__io.width(0);
+	
+	// [22.2.2.2.2] Stage 4.
+	// Write resulting, fully-formatted string to output iterator.
+	return std::__write(__s, __ws, __len);
+      }
+  
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+    {
+      const ios_base::fmtflags __flags = __io.flags();
+      if ((__flags & ios_base::boolalpha) == 0)
+        {
+          const long __l = __v;
+          __s = _M_insert_int(__s, __io, __fill, __l);
+        }
+      else
+        {
+	  typedef __numpunct_cache<_CharT>              __cache_type;
+	  __use_cache<__cache_type> __uc;
+	  const locale& __loc = __io._M_getloc();
+	  const __cache_type* __lc = __uc(__loc);
+
+	  const _CharT* __name = __v ? __lc->_M_truename
+	                             : __lc->_M_falsename;
+	  int __len = __v ? __lc->_M_truename_size
+	                  : __lc->_M_falsename_size;
+
+	  const streamsize __w = __io.width();
+	  if (__w > static_cast<streamsize>(__len))
+	    {
+	      const streamsize __plen = __w - __len;
+	      _CharT* __ps
+		= static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+							* __plen));
+
+	      char_traits<_CharT>::assign(__ps, __plen, __fill);
+	      __io.width(0);
+
+	      if ((__flags & ios_base::adjustfield) == ios_base::left)
+		{
+		  __s = std::__write(__s, __name, __len);
+		  __s = std::__write(__s, __ps, __plen);
+		}
+	      else
+		{
+		  __s = std::__write(__s, __ps, __plen);
+		  __s = std::__write(__s, __name, __len);
+		}
+	      return __s;
+	    }
+	  __io.width(0);
+	  __s = std::__write(__s, __name, __len);
+	}
+      return __s;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+    { return _M_insert_float(__s, __io, __fill, char(), __v); }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    __do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+    { return _M_insert_float(__s, __io, __fill, char(), __v); }
+#endif
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill,
+	   long double __v) const
+    { return _M_insert_float(__s, __io, __fill, 'L', __v); }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill,
+           const void* __v) const
+    {
+      const ios_base::fmtflags __flags = __io.flags();
+      const ios_base::fmtflags __fmt = ~(ios_base::basefield
+					 | ios_base::uppercase);
+      __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
+
+      typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+					     <= sizeof(unsigned long)),
+	unsigned long, unsigned long long>::__type _UIntPtrType;       
+
+      __s = _M_insert_int(__s, __io, __fill,
+			  reinterpret_cast<_UIntPtrType>(__v));
+      __io.flags(__flags);
+      return __s;
+    }
+
+_GLIBCXX_END_NAMESPACE_LDBL
+
+  // Construct correctly padded string, as per 22.2.2.2.2
+  // Assumes
+  // __newlen > __oldlen
+  // __news is allocated for __newlen size
+
+  // NB: Of the two parameters, _CharT can be deduced from the
+  // function arguments. The other (_Traits) has to be explicitly specified.
+  template<typename _CharT, typename _Traits>
+    void
+    __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
+				   _CharT* __news, const _CharT* __olds,
+				   streamsize __newlen, streamsize __oldlen)
+    {
+      const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
+      const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
+
+      // Padding last.
+      if (__adjust == ios_base::left)
+	{
+	  _Traits::copy(__news, __olds, __oldlen);
+	  _Traits::assign(__news + __oldlen, __plen, __fill);
+	  return;
+	}
+
+      size_t __mod = 0;
+      if (__adjust == ios_base::internal)
+	{
+	  // Pad after the sign, if there is one.
+	  // Pad after 0[xX], if there is one.
+	  // Who came up with these rules, anyway? Jeeze.
+          const locale& __loc = __io._M_getloc();
+	  const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+	  if (__ctype.widen('-') == __olds[0]
+	      || __ctype.widen('+') == __olds[0])
+	    {
+	      __news[0] = __olds[0];
+	      __mod = 1;
+	      ++__news;
+	    }
+	  else if (__ctype.widen('0') == __olds[0]
+		   && __oldlen > 1
+		   && (__ctype.widen('x') == __olds[1]
+		       || __ctype.widen('X') == __olds[1]))
+	    {
+	      __news[0] = __olds[0];
+	      __news[1] = __olds[1];
+	      __mod = 2;
+	      __news += 2;
+	    }
+	  // else Padding first.
+	}
+      _Traits::assign(__news, __plen, __fill);
+      _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
+    }
+
+  template<typename _CharT>
+    _CharT*
+    __add_grouping(_CharT* __s, _CharT __sep,
+		   const char* __gbeg, size_t __gsize,
+		   const _CharT* __first, const _CharT* __last)
+    {
+      size_t __idx = 0;
+      size_t __ctr = 0;
+
+      while (__last - __first > __gbeg[__idx]
+	     && static_cast<signed char>(__gbeg[__idx]) > 0
+	     && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
+	{
+	  __last -= __gbeg[__idx];
+	  __idx < __gsize - 1 ? ++__idx : ++__ctr;
+	}
+
+      while (__first != __last)
+	*__s++ = *__first++;
+
+      while (__ctr--)
+	{
+	  *__s++ = __sep;	  
+	  for (char __i = __gbeg[__idx]; __i > 0; --__i)
+	    *__s++ = *__first++;
+	}
+
+      while (__idx--)
+	{
+	  *__s++ = __sep;	  
+	  for (char __i = __gbeg[__idx]; __i > 0; --__i)
+	    *__s++ = *__first++;
+	}
+
+      return __s;
+    }
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct<char>;
+  extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct_byname<char>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL num_get<char>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL num_put<char>;
+  extern template class ctype_byname<char>;
+
+  extern template
+    const ctype<char>&
+    use_facet<ctype<char> >(const locale&);
+
+  extern template
+    const numpunct<char>&
+    use_facet<numpunct<char> >(const locale&);
+
+  extern template
+    const num_put<char>&
+    use_facet<num_put<char> >(const locale&);
+
+  extern template
+    const num_get<char>&
+    use_facet<num_get<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<ctype<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<numpunct<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_put<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_get<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct<wchar_t>;
+  extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct_byname<wchar_t>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL num_get<wchar_t>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL num_put<wchar_t>;
+  extern template class ctype_byname<wchar_t>;
+
+  extern template
+    const ctype<wchar_t>&
+    use_facet<ctype<wchar_t> >(const locale&);
+
+  extern template
+    const numpunct<wchar_t>&
+    use_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template
+    const num_put<wchar_t>&
+    use_facet<num_put<wchar_t> >(const locale&);
+
+  extern template
+    const num_get<wchar_t>&
+    use_facet<num_get<wchar_t> >(const locale&);
+
+ extern template
+    bool
+    has_facet<ctype<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_put<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_get<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif

+ 2015 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets_nonio.h

@@ -0,0 +1,2015 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_facets_nonio.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#ifndef _LOCALE_FACETS_NONIO_H
+#define _LOCALE_FACETS_NONIO_H 1
+
+#pragma GCC system_header
+
+#include <ctime>	// For struct tm
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @brief  Time format ordering data.
+   *  @ingroup locales
+   *
+   *  This class provides an enum representing different orderings of
+   *  time: day, month, and year.
+  */
+  class time_base
+  {
+  public:
+    enum dateorder { no_order, dmy, mdy, ymd, ydm };
+  };
+
+  template<typename _CharT>
+    struct __timepunct_cache : public locale::facet
+    {
+      // List of all known timezones, with GMT first.
+      static const _CharT*		_S_timezones[14];
+
+      const _CharT*			_M_date_format;
+      const _CharT*			_M_date_era_format;
+      const _CharT*			_M_time_format;
+      const _CharT*			_M_time_era_format;
+      const _CharT*			_M_date_time_format;
+      const _CharT*			_M_date_time_era_format;
+      const _CharT*			_M_am;
+      const _CharT*			_M_pm;
+      const _CharT*			_M_am_pm_format;
+
+      // Day names, starting with "C"'s Sunday.
+      const _CharT*			_M_day1;
+      const _CharT*			_M_day2;
+      const _CharT*			_M_day3;
+      const _CharT*			_M_day4;
+      const _CharT*			_M_day5;
+      const _CharT*			_M_day6;
+      const _CharT*			_M_day7;
+
+      // Abbreviated day names, starting with "C"'s Sun.
+      const _CharT*			_M_aday1;
+      const _CharT*			_M_aday2;
+      const _CharT*			_M_aday3;
+      const _CharT*			_M_aday4;
+      const _CharT*			_M_aday5;
+      const _CharT*			_M_aday6;
+      const _CharT*			_M_aday7;
+
+      // Month names, starting with "C"'s January.
+      const _CharT*			_M_month01;
+      const _CharT*			_M_month02;
+      const _CharT*			_M_month03;
+      const _CharT*			_M_month04;
+      const _CharT*			_M_month05;
+      const _CharT*			_M_month06;
+      const _CharT*			_M_month07;
+      const _CharT*			_M_month08;
+      const _CharT*			_M_month09;
+      const _CharT*			_M_month10;
+      const _CharT*			_M_month11;
+      const _CharT*			_M_month12;
+
+      // Abbreviated month names, starting with "C"'s Jan.
+      const _CharT*			_M_amonth01;
+      const _CharT*			_M_amonth02;
+      const _CharT*			_M_amonth03;
+      const _CharT*			_M_amonth04;
+      const _CharT*			_M_amonth05;
+      const _CharT*			_M_amonth06;
+      const _CharT*			_M_amonth07;
+      const _CharT*			_M_amonth08;
+      const _CharT*			_M_amonth09;
+      const _CharT*			_M_amonth10;
+      const _CharT*			_M_amonth11;
+      const _CharT*			_M_amonth12;
+
+      bool				_M_allocated;
+
+      __timepunct_cache(size_t __refs = 0) : facet(__refs),
+      _M_date_format(0), _M_date_era_format(0), _M_time_format(0),
+      _M_time_era_format(0), _M_date_time_format(0),
+      _M_date_time_era_format(0), _M_am(0), _M_pm(0),
+      _M_am_pm_format(0), _M_day1(0), _M_day2(0), _M_day3(0),
+      _M_day4(0), _M_day5(0), _M_day6(0), _M_day7(0),
+      _M_aday1(0), _M_aday2(0), _M_aday3(0), _M_aday4(0),
+      _M_aday5(0), _M_aday6(0), _M_aday7(0), _M_month01(0),
+      _M_month02(0), _M_month03(0), _M_month04(0), _M_month05(0),
+      _M_month06(0), _M_month07(0), _M_month08(0), _M_month09(0),
+      _M_month10(0), _M_month11(0), _M_month12(0), _M_amonth01(0),
+      _M_amonth02(0), _M_amonth03(0), _M_amonth04(0),
+      _M_amonth05(0), _M_amonth06(0), _M_amonth07(0),
+      _M_amonth08(0), _M_amonth09(0), _M_amonth10(0),
+      _M_amonth11(0), _M_amonth12(0), _M_allocated(false)
+      { }
+
+      ~__timepunct_cache();
+
+    private:
+      __timepunct_cache&
+      operator=(const __timepunct_cache&);
+      
+      explicit
+      __timepunct_cache(const __timepunct_cache&);
+    };
+
+  template<typename _CharT>
+    __timepunct_cache<_CharT>::~__timepunct_cache()
+    {
+      if (_M_allocated)
+	{
+	  // Unused.
+	}
+    }
+
+  // Specializations.
+  template<>
+    const char*
+    __timepunct_cache<char>::_S_timezones[14];
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    const wchar_t*
+    __timepunct_cache<wchar_t>::_S_timezones[14];
+#endif
+
+  // Generic.
+  template<typename _CharT>
+    const _CharT* __timepunct_cache<_CharT>::_S_timezones[14];
+
+  template<typename _CharT>
+    class __timepunct : public locale::facet
+    {
+    public:
+      // Types:
+      typedef _CharT			__char_type;
+      typedef __timepunct_cache<_CharT>	__cache_type;
+
+    protected:
+      __cache_type*			_M_data;
+      __c_locale			_M_c_locale_timepunct;
+      const char*			_M_name_timepunct;
+
+    public:
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      explicit
+      __timepunct(size_t __refs = 0);
+
+      explicit
+      __timepunct(__cache_type* __cache, size_t __refs = 0);
+
+      /**
+       *  @brief  Internal constructor. Not for general use.
+       *
+       *  This is a constructor for use by the library itself to set up new
+       *  locales.
+       *
+       *  @param __cloc  The C locale.
+       *  @param __s  The name of a locale.
+       *  @param refs  Passed to the base facet class.
+      */
+      explicit
+      __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);
+
+      // FIXME: for error checking purposes _M_put should return the return
+      // value of strftime/wcsftime.
+      void
+      _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
+	     const tm* __tm) const throw ();
+
+      void
+      _M_date_formats(const _CharT** __date) const
+      {
+	// Always have default first.
+	__date[0] = _M_data->_M_date_format;
+	__date[1] = _M_data->_M_date_era_format;
+      }
+
+      void
+      _M_time_formats(const _CharT** __time) const
+      {
+	// Always have default first.
+	__time[0] = _M_data->_M_time_format;
+	__time[1] = _M_data->_M_time_era_format;
+      }
+
+      void
+      _M_date_time_formats(const _CharT** __dt) const
+      {
+	// Always have default first.
+	__dt[0] = _M_data->_M_date_time_format;
+	__dt[1] = _M_data->_M_date_time_era_format;
+      }
+
+      void
+      _M_am_pm_format(const _CharT* __ampm) const
+      { __ampm = _M_data->_M_am_pm_format; }
+
+      void
+      _M_am_pm(const _CharT** __ampm) const
+      {
+	__ampm[0] = _M_data->_M_am;
+	__ampm[1] = _M_data->_M_pm;
+      }
+
+      void
+      _M_days(const _CharT** __days) const
+      {
+	__days[0] = _M_data->_M_day1;
+	__days[1] = _M_data->_M_day2;
+	__days[2] = _M_data->_M_day3;
+	__days[3] = _M_data->_M_day4;
+	__days[4] = _M_data->_M_day5;
+	__days[5] = _M_data->_M_day6;
+	__days[6] = _M_data->_M_day7;
+      }
+
+      void
+      _M_days_abbreviated(const _CharT** __days) const
+      {
+	__days[0] = _M_data->_M_aday1;
+	__days[1] = _M_data->_M_aday2;
+	__days[2] = _M_data->_M_aday3;
+	__days[3] = _M_data->_M_aday4;
+	__days[4] = _M_data->_M_aday5;
+	__days[5] = _M_data->_M_aday6;
+	__days[6] = _M_data->_M_aday7;
+      }
+
+      void
+      _M_months(const _CharT** __months) const
+      {
+	__months[0] = _M_data->_M_month01;
+	__months[1] = _M_data->_M_month02;
+	__months[2] = _M_data->_M_month03;
+	__months[3] = _M_data->_M_month04;
+	__months[4] = _M_data->_M_month05;
+	__months[5] = _M_data->_M_month06;
+	__months[6] = _M_data->_M_month07;
+	__months[7] = _M_data->_M_month08;
+	__months[8] = _M_data->_M_month09;
+	__months[9] = _M_data->_M_month10;
+	__months[10] = _M_data->_M_month11;
+	__months[11] = _M_data->_M_month12;
+      }
+
+      void
+      _M_months_abbreviated(const _CharT** __months) const
+      {
+	__months[0] = _M_data->_M_amonth01;
+	__months[1] = _M_data->_M_amonth02;
+	__months[2] = _M_data->_M_amonth03;
+	__months[3] = _M_data->_M_amonth04;
+	__months[4] = _M_data->_M_amonth05;
+	__months[5] = _M_data->_M_amonth06;
+	__months[6] = _M_data->_M_amonth07;
+	__months[7] = _M_data->_M_amonth08;
+	__months[8] = _M_data->_M_amonth09;
+	__months[9] = _M_data->_M_amonth10;
+	__months[10] = _M_data->_M_amonth11;
+	__months[11] = _M_data->_M_amonth12;
+      }
+
+    protected:
+      virtual
+      ~__timepunct();
+
+      // For use at construction time only.
+      void
+      _M_initialize_timepunct(__c_locale __cloc = 0);
+    };
+
+  template<typename _CharT>
+    locale::id __timepunct<_CharT>::id;
+
+  // Specializations.
+  template<>
+    void
+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
+
+  template<>
+    void
+    __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const throw ();
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    void
+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
+
+  template<>
+    void
+    __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*,
+				 const tm*) const throw ();
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+  // Include host and configuration specific timepunct functions.
+  #include <bits/time_members.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+
+  /**
+   *  @brief  Primary class template time_get.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to parse and return a date or
+   *  time from a string.  It is used by the istream numeric
+   *  extraction operators.
+   *
+   *  The time_get template uses protected virtual functions to provide the
+   *  actual results.  The public accessors forward the call to the virtual
+   *  functions.  These virtual functions are hooks for developers to
+   *  implement the behavior they require from the time_get facet.
+  */
+  template<typename _CharT, typename _InIter>
+    class time_get : public locale::facet, public time_base
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef _InIter			iter_type;
+      //@}
+
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      time_get(size_t __refs = 0)
+      : facet (__refs) { }
+
+      /**
+       *  @brief  Return preferred order of month, day, and year.
+       *
+       *  This function returns an enum from time_base::dateorder giving the
+       *  preferred ordering if the format @a x given to time_put::put() only
+       *  uses month, day, and year.  If the format @a x for the associated
+       *  locale uses other fields, this function returns
+       *  time_base::dateorder::noorder.
+       *
+       *  NOTE: The library always returns noorder at the moment.
+       *
+       *  @return  A member of time_base::dateorder.
+      */
+      dateorder
+      date_order()  const
+      { return this->do_date_order(); }
+
+      /**
+       *  @brief  Parse input time string.
+       *
+       *  This function parses a time according to the format @a X and puts the
+       *  results into a user-supplied struct tm.  The result is returned by
+       *  calling time_get::do_get_time().
+       *
+       *  If there is a valid time string according to format @a X, @a tm will
+       *  be filled in accordingly and the returned iterator will point to the
+       *  first character beyond the time string.  If an error occurs before
+       *  the end, err |= ios_base::failbit.  If parsing reads all the
+       *  characters, err |= ios_base::eofbit.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond time string.
+      */
+      iter_type
+      get_time(iter_type __beg, iter_type __end, ios_base& __io,
+	       ios_base::iostate& __err, tm* __tm)  const
+      { return this->do_get_time(__beg, __end, __io, __err, __tm); }
+
+      /**
+       *  @brief  Parse input date string.
+       *
+       *  This function parses a date according to the format @a x and puts the
+       *  results into a user-supplied struct tm.  The result is returned by
+       *  calling time_get::do_get_date().
+       *
+       *  If there is a valid date string according to format @a x, @a tm will
+       *  be filled in accordingly and the returned iterator will point to the
+       *  first character beyond the date string.  If an error occurs before
+       *  the end, err |= ios_base::failbit.  If parsing reads all the
+       *  characters, err |= ios_base::eofbit.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond date string.
+      */
+      iter_type
+      get_date(iter_type __beg, iter_type __end, ios_base& __io,
+	       ios_base::iostate& __err, tm* __tm)  const
+      { return this->do_get_date(__beg, __end, __io, __err, __tm); }
+
+      /**
+       *  @brief  Parse input weekday string.
+       *
+       *  This function parses a weekday name and puts the results into a
+       *  user-supplied struct tm.  The result is returned by calling
+       *  time_get::do_get_weekday().
+       *
+       *  Parsing starts by parsing an abbreviated weekday name.  If a valid
+       *  abbreviation is followed by a character that would lead to the full
+       *  weekday name, parsing continues until the full name is found or an
+       *  error occurs.  Otherwise parsing finishes at the end of the
+       *  abbreviated name.
+       *
+       *  If an error occurs before the end, err |= ios_base::failbit.  If
+       *  parsing reads all the characters, err |= ios_base::eofbit.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond weekday name.
+      */
+      iter_type
+      get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
+		  ios_base::iostate& __err, tm* __tm) const
+      { return this->do_get_weekday(__beg, __end, __io, __err, __tm); }
+
+      /**
+       *  @brief  Parse input month string.
+       *
+       *  This function parses a month name and puts the results into a
+       *  user-supplied struct tm.  The result is returned by calling
+       *  time_get::do_get_monthname().
+       *
+       *  Parsing starts by parsing an abbreviated month name.  If a valid
+       *  abbreviation is followed by a character that would lead to the full
+       *  month name, parsing continues until the full name is found or an
+       *  error occurs.  Otherwise parsing finishes at the end of the
+       *  abbreviated name.
+       *
+       *  If an error occurs before the end, err |= ios_base::failbit.  If
+       *  parsing reads all the characters, err |=
+       *  ios_base::eofbit.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond month name.
+      */
+      iter_type
+      get_monthname(iter_type __beg, iter_type __end, ios_base& __io,
+		    ios_base::iostate& __err, tm* __tm) const
+      { return this->do_get_monthname(__beg, __end, __io, __err, __tm); }
+
+      /**
+       *  @brief  Parse input year string.
+       *
+       *  This function reads up to 4 characters to parse a year string and
+       *  puts the results into a user-supplied struct tm.  The result is
+       *  returned by calling time_get::do_get_year().
+       *
+       *  4 consecutive digits are interpreted as a full year.  If there are
+       *  exactly 2 consecutive digits, the library interprets this as the
+       *  number of years since 1900.
+       *
+       *  If an error occurs before the end, err |= ios_base::failbit.  If
+       *  parsing reads all the characters, err |= ios_base::eofbit.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond year.
+      */
+      iter_type
+      get_year(iter_type __beg, iter_type __end, ios_base& __io,
+	       ios_base::iostate& __err, tm* __tm) const
+      { return this->do_get_year(__beg, __end, __io, __err, __tm); }
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Parse input string according to format.
+       *
+       *  This function calls time_get::do_get with the provided
+       *  parameters.  @see do_get() and get().
+       *
+       *  @param __s        Start of string to parse.
+       *  @param __end      End of string to parse.
+       *  @param __io       Source of the locale.
+       *  @param __err      Error flags to set.
+       *  @param __tm       Pointer to struct tm to fill in.
+       *  @param __format   Format specifier.
+       *  @param __modifier Format modifier.
+       *  @return  Iterator to first char not parsed.
+       */
+      inline
+      iter_type get(iter_type __s, iter_type __end, ios_base& __io,
+                    ios_base::iostate& __err, tm* __tm, char __format,
+                    char __modifier = 0) const
+      {
+        return this->do_get(__s, __end, __io, __err, __tm, __format,
+                            __modifier);
+      }
+
+      /**
+       *  @brief  Parse input string according to format.
+       *
+       *  This function parses the input string according to a
+       *  provided format string.  It does the inverse of
+       *  time_put::put.  The format string follows the format
+       *  specified for strftime(3)/strptime(3).  The actual parsing
+       *  is done by time_get::do_get.
+       *
+       *  @param __s        Start of string to parse.
+       *  @param __end      End of string to parse.
+       *  @param __io       Source of the locale.
+       *  @param __err      Error flags to set.
+       *  @param __tm       Pointer to struct tm to fill in.
+       *  @param __fmt      Start of the format string.
+       *  @param __fmtend   End of the format string.
+       *  @return  Iterator to first char not parsed.
+       */
+      iter_type get(iter_type __s, iter_type __end, ios_base& __io,
+                    ios_base::iostate& __err, tm* __tm, const char_type* __fmt,
+                    const char_type* __fmtend) const;
+#endif // __cplusplus >= 201103L
+
+    protected:
+      /// Destructor.
+      virtual
+      ~time_get() { }
+
+      /**
+       *  @brief  Return preferred order of month, day, and year.
+       *
+       *  This function returns an enum from time_base::dateorder giving the
+       *  preferred ordering if the format @a x given to time_put::put() only
+       *  uses month, day, and year.  This function is a hook for derived
+       *  classes to change the value returned.
+       *
+       *  @return  A member of time_base::dateorder.
+      */
+      virtual dateorder
+      do_date_order() const;
+
+      /**
+       *  @brief  Parse input time string.
+       *
+       *  This function parses a time according to the format @a x and puts the
+       *  results into a user-supplied struct tm.  This function is a hook for
+       *  derived classes to change the value returned.  @see get_time() for
+       *  details.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond time string.
+      */
+      virtual iter_type
+      do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
+		  ios_base::iostate& __err, tm* __tm) const;
+
+      /**
+       *  @brief  Parse input date string.
+       *
+       *  This function parses a date according to the format @a X and puts the
+       *  results into a user-supplied struct tm.  This function is a hook for
+       *  derived classes to change the value returned.  @see get_date() for
+       *  details.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond date string.
+      */
+      virtual iter_type
+      do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
+		  ios_base::iostate& __err, tm* __tm) const;
+
+      /**
+       *  @brief  Parse input weekday string.
+       *
+       *  This function parses a weekday name and puts the results into a
+       *  user-supplied struct tm.  This function is a hook for derived
+       *  classes to change the value returned.  @see get_weekday() for
+       *  details.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond weekday name.
+      */
+      virtual iter_type
+      do_get_weekday(iter_type __beg, iter_type __end, ios_base&,
+		     ios_base::iostate& __err, tm* __tm) const;
+
+      /**
+       *  @brief  Parse input month string.
+       *
+       *  This function parses a month name and puts the results into a
+       *  user-supplied struct tm.  This function is a hook for derived
+       *  classes to change the value returned.  @see get_monthname() for
+       *  details.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond month name.
+      */
+      virtual iter_type
+      do_get_monthname(iter_type __beg, iter_type __end, ios_base&,
+		       ios_base::iostate& __err, tm* __tm) const;
+
+      /**
+       *  @brief  Parse input year string.
+       *
+       *  This function reads up to 4 characters to parse a year string and
+       *  puts the results into a user-supplied struct tm.  This function is a
+       *  hook for derived classes to change the value returned.  @see
+       *  get_year() for details.
+       *
+       *  @param  __beg  Start of string to parse.
+       *  @param  __end  End of string to parse.
+       *  @param  __io  Source of the locale.
+       *  @param  __err  Error flags to set.
+       *  @param  __tm  Pointer to struct tm to fill in.
+       *  @return  Iterator to first char beyond year.
+      */
+      virtual iter_type
+      do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
+		  ios_base::iostate& __err, tm* __tm) const;
+
+#if __cplusplus >= 201103L
+      /**
+       *  @brief  Parse input string according to format.
+       *
+       *  This function parses the string according to the provided
+       *  format and optional modifier.  This function is a hook for
+       *  derived classes to change the value returned.  @see get()
+       *  for more details.
+       *
+       *  @param __s        Start of string to parse.
+       *  @param __end      End of string to parse.
+       *  @param __f        Source of the locale.
+       *  @param __err      Error flags to set.
+       *  @param __tm       Pointer to struct tm to fill in.
+       *  @param __format   Format specifier.
+       *  @param __modifier Format modifier.
+       *  @return  Iterator to first char not parsed.
+       */
+#if _GLIBCXX_USE_CXX11_ABI
+      virtual
+#endif
+      iter_type
+      do_get(iter_type __s, iter_type __end, ios_base& __f,
+             ios_base::iostate& __err, tm* __tm,
+             char __format, char __modifier) const;
+#endif // __cplusplus >= 201103L
+
+      // Extract numeric component of length __len.
+      iter_type
+      _M_extract_num(iter_type __beg, iter_type __end, int& __member,
+		     int __min, int __max, size_t __len,
+		     ios_base& __io, ios_base::iostate& __err) const;
+
+      // Extract any unique array of string literals in a const _CharT* array.
+      iter_type
+      _M_extract_name(iter_type __beg, iter_type __end, int& __member,
+		      const _CharT** __names, size_t __indexlen,
+		      ios_base& __io, ios_base::iostate& __err) const;
+
+      // Extract day or month name in a const _CharT* array.
+      iter_type
+      _M_extract_wday_or_month(iter_type __beg, iter_type __end, int& __member,
+			       const _CharT** __names, size_t __indexlen,
+			       ios_base& __io, ios_base::iostate& __err) const;
+
+      // Extract on a component-by-component basis, via __format argument.
+      iter_type
+      _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
+			    ios_base::iostate& __err, tm* __tm,
+			    const _CharT* __format) const;
+    };
+
+  template<typename _CharT, typename _InIter>
+    locale::id time_get<_CharT, _InIter>::id;
+
+  /// class time_get_byname [22.2.5.2].
+  template<typename _CharT, typename _InIter>
+    class time_get_byname : public time_get<_CharT, _InIter>
+    {
+    public:
+      // Types:
+      typedef _CharT			char_type;
+      typedef _InIter			iter_type;
+
+      explicit
+      time_get_byname(const char*, size_t __refs = 0)
+      : time_get<_CharT, _InIter>(__refs) { }
+
+#if __cplusplus >= 201103L
+      explicit
+      time_get_byname(const string& __s, size_t __refs = 0)
+      : time_get_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~time_get_byname() { }
+    };
+
+_GLIBCXX_END_NAMESPACE_CXX11
+
+  /**
+   *  @brief  Primary class template time_put.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to format and output dates and times
+   *  according to formats used by strftime().
+   *
+   *  The time_put template uses protected virtual functions to provide the
+   *  actual results.  The public accessors forward the call to the virtual
+   *  functions.  These virtual functions are hooks for developers to
+   *  implement the behavior they require from the time_put facet.
+  */
+  template<typename _CharT, typename _OutIter>
+    class time_put : public locale::facet
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef _OutIter			iter_type;
+      //@}
+
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      time_put(size_t __refs = 0)
+      : facet(__refs) { }
+
+      /**
+       *  @brief  Format and output a time or date.
+       *
+       *  This function formats the data in struct tm according to the
+       *  provided format string.  The format string is interpreted as by
+       *  strftime().
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __io  Source of locale.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __tm  Struct tm with date and time info to format.
+       *  @param  __beg  Start of format string.
+       *  @param  __end  End of format string.
+       *  @return  Iterator after writing.
+       */
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+	  const _CharT* __beg, const _CharT* __end) const;
+
+      /**
+       *  @brief  Format and output a time or date.
+       *
+       *  This function formats the data in struct tm according to the
+       *  provided format char and optional modifier.  The format and modifier
+       *  are interpreted as by strftime().  It does so by returning
+       *  time_put::do_put().
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __io  Source of locale.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __tm  Struct tm with date and time info to format.
+       *  @param  __format  Format char.
+       *  @param  __mod  Optional modifier char.
+       *  @return  Iterator after writing.
+       */
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+	  const tm* __tm, char __format, char __mod = 0) const
+      { return this->do_put(__s, __io, __fill, __tm, __format, __mod); }
+
+    protected:
+      /// Destructor.
+      virtual
+      ~time_put()
+      { }
+
+      /**
+       *  @brief  Format and output a time or date.
+       *
+       *  This function formats the data in struct tm according to the
+       *  provided format char and optional modifier.  This function is a hook
+       *  for derived classes to change the value returned.  @see put() for
+       *  more details.
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __io  Source of locale.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __tm  Struct tm with date and time info to format.
+       *  @param  __format  Format char.
+       *  @param  __mod  Optional modifier char.
+       *  @return  Iterator after writing.
+       */
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+	     char __format, char __mod) const;
+    };
+
+  template<typename _CharT, typename _OutIter>
+    locale::id time_put<_CharT, _OutIter>::id;
+
+  /// class time_put_byname [22.2.5.4].
+  template<typename _CharT, typename _OutIter>
+    class time_put_byname : public time_put<_CharT, _OutIter>
+    {
+    public:
+      // Types:
+      typedef _CharT			char_type;
+      typedef _OutIter			iter_type;
+
+      explicit
+      time_put_byname(const char*, size_t __refs = 0)
+      : time_put<_CharT, _OutIter>(__refs)
+      { };
+
+#if __cplusplus >= 201103L
+      explicit
+      time_put_byname(const string& __s, size_t __refs = 0)
+      : time_put_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~time_put_byname() { }
+    };
+
+
+  /**
+   *  @brief  Money format ordering data.
+   *  @ingroup locales
+   *
+   *  This class contains an ordered array of 4 fields to represent the
+   *  pattern for formatting a money amount.  Each field may contain one entry
+   *  from the part enum.  symbol, sign, and value must be present and the
+   *  remaining field must contain either none or space.  @see
+   *  moneypunct::pos_format() and moneypunct::neg_format() for details of how
+   *  these fields are interpreted.
+  */
+  class money_base
+  {
+  public:
+    enum part { none, space, symbol, sign, value };
+    struct pattern { char field[4]; };
+
+    static const pattern _S_default_pattern;
+
+    enum
+    {
+      _S_minus,
+      _S_zero,
+      _S_end = 11
+    };
+
+    // String literal of acceptable (narrow) input/output, for
+    // money_get/money_put. "-0123456789"
+    static const char* _S_atoms;
+
+    // Construct and return valid pattern consisting of some combination of:
+    // space none symbol sign value
+    _GLIBCXX_CONST static pattern
+    _S_construct_pattern(char __precedes, char __space, char __posn) throw ();
+  };
+
+  template<typename _CharT, bool _Intl>
+    struct __moneypunct_cache : public locale::facet
+    {
+      const char*			_M_grouping;
+      size_t                            _M_grouping_size;
+      bool				_M_use_grouping;
+      _CharT				_M_decimal_point;
+      _CharT				_M_thousands_sep;
+      const _CharT*			_M_curr_symbol;
+      size_t                            _M_curr_symbol_size;
+      const _CharT*			_M_positive_sign;
+      size_t                            _M_positive_sign_size;
+      const _CharT*			_M_negative_sign;
+      size_t                            _M_negative_sign_size;
+      int				_M_frac_digits;
+      money_base::pattern		_M_pos_format;
+      money_base::pattern	        _M_neg_format;
+
+      // A list of valid numeric literals for input and output: in the standard
+      // "C" locale, this is "-0123456789". This array contains the chars after
+      // having been passed through the current locale's ctype<_CharT>.widen().
+      _CharT				_M_atoms[money_base::_S_end];
+
+      bool				_M_allocated;
+
+      __moneypunct_cache(size_t __refs = 0) : facet(__refs),
+      _M_grouping(0), _M_grouping_size(0), _M_use_grouping(false),
+      _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()),
+      _M_curr_symbol(0), _M_curr_symbol_size(0),
+      _M_positive_sign(0), _M_positive_sign_size(0),
+      _M_negative_sign(0), _M_negative_sign_size(0),
+      _M_frac_digits(0),
+      _M_pos_format(money_base::pattern()),
+      _M_neg_format(money_base::pattern()), _M_allocated(false)
+      { }
+
+      ~__moneypunct_cache();
+
+      void
+      _M_cache(const locale& __loc);
+
+    private:
+      __moneypunct_cache&
+      operator=(const __moneypunct_cache&);
+      
+      explicit
+      __moneypunct_cache(const __moneypunct_cache&);
+    };
+
+  template<typename _CharT, bool _Intl>
+    __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache()
+    {
+      if (_M_allocated)
+	{
+	  delete [] _M_grouping;
+	  delete [] _M_curr_symbol;
+	  delete [] _M_positive_sign;
+	  delete [] _M_negative_sign;
+	}
+    }
+
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+
+  /**
+   *  @brief  Primary class template moneypunct.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the punctuation, grouping and other formatting
+   *  features of money amount string representations.
+  */
+  template<typename _CharT, bool _Intl>
+    class moneypunct : public locale::facet, public money_base
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+      //@}
+      typedef __moneypunct_cache<_CharT, _Intl>     __cache_type;
+
+    private:
+      __cache_type*			_M_data;
+
+    public:
+      /// This value is provided by the standard, but no reason for its
+      /// existence.
+      static const bool			intl = _Intl;
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      moneypunct(size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_moneypunct(); }
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is an internal constructor.
+       *
+       *  @param __cache  Cache for optimization.
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      moneypunct(__cache_type* __cache, size_t __refs = 0)
+      : facet(__refs), _M_data(__cache)
+      { _M_initialize_moneypunct(); }
+
+      /**
+       *  @brief  Internal constructor. Not for general use.
+       *
+       *  This is a constructor for use by the library itself to set up new
+       *  locales.
+       *
+       *  @param __cloc  The C locale.
+       *  @param __s  The name of a locale.
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_moneypunct(__cloc, __s); }
+
+      /**
+       *  @brief  Return decimal point character.
+       *
+       *  This function returns a char_type to use as a decimal point.  It
+       *  does so by returning returning
+       *  moneypunct<char_type>::do_decimal_point().
+       *
+       *  @return  @a char_type representing a decimal point.
+      */
+      char_type
+      decimal_point() const
+      { return this->do_decimal_point(); }
+
+      /**
+       *  @brief  Return thousands separator character.
+       *
+       *  This function returns a char_type to use as a thousands
+       *  separator.  It does so by returning returning
+       *  moneypunct<char_type>::do_thousands_sep().
+       *
+       *  @return  char_type representing a thousands separator.
+      */
+      char_type
+      thousands_sep() const
+      { return this->do_thousands_sep(); }
+
+      /**
+       *  @brief  Return grouping specification.
+       *
+       *  This function returns a string representing groupings for the
+       *  integer part of an amount.  Groupings indicate where thousands
+       *  separators should be inserted.
+       *
+       *  Each char in the return string is interpret as an integer rather
+       *  than a character.  These numbers represent the number of digits in a
+       *  group.  The first char in the string represents the number of digits
+       *  in the least significant group.  If a char is negative, it indicates
+       *  an unlimited number of digits for the group.  If more chars from the
+       *  string are required to group a number, the last char is used
+       *  repeatedly.
+       *
+       *  For example, if the grouping() returns <code>\003\002</code>
+       *  and is applied to the number 123456789, this corresponds to
+       *  12,34,56,789.  Note that if the string was <code>32</code>, this would
+       *  put more than 50 digits into the least significant group if
+       *  the character set is ASCII.
+       *
+       *  The string is returned by calling
+       *  moneypunct<char_type>::do_grouping().
+       *
+       *  @return  string representing grouping specification.
+      */
+      string
+      grouping() const
+      { return this->do_grouping(); }
+
+      /**
+       *  @brief  Return currency symbol string.
+       *
+       *  This function returns a string_type to use as a currency symbol.  It
+       *  does so by returning returning
+       *  moneypunct<char_type>::do_curr_symbol().
+       *
+       *  @return  @a string_type representing a currency symbol.
+      */
+      string_type
+      curr_symbol() const
+      { return this->do_curr_symbol(); }
+
+      /**
+       *  @brief  Return positive sign string.
+       *
+       *  This function returns a string_type to use as a sign for positive
+       *  amounts.  It does so by returning returning
+       *  moneypunct<char_type>::do_positive_sign().
+       *
+       *  If the return value contains more than one character, the first
+       *  character appears in the position indicated by pos_format() and the
+       *  remainder appear at the end of the formatted string.
+       *
+       *  @return  @a string_type representing a positive sign.
+      */
+      string_type
+      positive_sign() const
+      { return this->do_positive_sign(); }
+
+      /**
+       *  @brief  Return negative sign string.
+       *
+       *  This function returns a string_type to use as a sign for negative
+       *  amounts.  It does so by returning returning
+       *  moneypunct<char_type>::do_negative_sign().
+       *
+       *  If the return value contains more than one character, the first
+       *  character appears in the position indicated by neg_format() and the
+       *  remainder appear at the end of the formatted string.
+       *
+       *  @return  @a string_type representing a negative sign.
+      */
+      string_type
+      negative_sign() const
+      { return this->do_negative_sign(); }
+
+      /**
+       *  @brief  Return number of digits in fraction.
+       *
+       *  This function returns the exact number of digits that make up the
+       *  fractional part of a money amount.  It does so by returning
+       *  returning moneypunct<char_type>::do_frac_digits().
+       *
+       *  The fractional part of a money amount is optional.  But if it is
+       *  present, there must be frac_digits() digits.
+       *
+       *  @return  Number of digits in amount fraction.
+      */
+      int
+      frac_digits() const
+      { return this->do_frac_digits(); }
+
+      //@{
+      /**
+       *  @brief  Return pattern for money values.
+       *
+       *  This function returns a pattern describing the formatting of a
+       *  positive or negative valued money amount.  It does so by returning
+       *  returning moneypunct<char_type>::do_pos_format() or
+       *  moneypunct<char_type>::do_neg_format().
+       *
+       *  The pattern has 4 fields describing the ordering of symbol, sign,
+       *  value, and none or space.  There must be one of each in the pattern.
+       *  The none and space enums may not appear in the first field and space
+       *  may not appear in the final field.
+       *
+       *  The parts of a money string must appear in the order indicated by
+       *  the fields of the pattern.  The symbol field indicates that the
+       *  value of curr_symbol() may be present.  The sign field indicates
+       *  that the value of positive_sign() or negative_sign() must be
+       *  present.  The value field indicates that the absolute value of the
+       *  money amount is present.  none indicates 0 or more whitespace
+       *  characters, except at the end, where it permits no whitespace.
+       *  space indicates that 1 or more whitespace characters must be
+       *  present.
+       *
+       *  For example, for the US locale and pos_format() pattern
+       *  {symbol,sign,value,none}, curr_symbol() == &apos;$&apos;
+       *  positive_sign() == &apos;+&apos;, and value 10.01, and
+       *  options set to force the symbol, the corresponding string is
+       *  <code>$+10.01</code>.
+       *
+       *  @return  Pattern for money values.
+      */
+      pattern
+      pos_format() const
+      { return this->do_pos_format(); }
+
+      pattern
+      neg_format() const
+      { return this->do_neg_format(); }
+      //@}
+
+    protected:
+      /// Destructor.
+      virtual
+      ~moneypunct();
+
+      /**
+       *  @brief  Return decimal point character.
+       *
+       *  Returns a char_type to use as a decimal point.  This function is a
+       *  hook for derived classes to change the value returned.
+       *
+       *  @return  @a char_type representing a decimal point.
+      */
+      virtual char_type
+      do_decimal_point() const
+      { return _M_data->_M_decimal_point; }
+
+      /**
+       *  @brief  Return thousands separator character.
+       *
+       *  Returns a char_type to use as a thousands separator.  This function
+       *  is a hook for derived classes to change the value returned.
+       *
+       *  @return  @a char_type representing a thousands separator.
+      */
+      virtual char_type
+      do_thousands_sep() const
+      { return _M_data->_M_thousands_sep; }
+
+      /**
+       *  @brief  Return grouping specification.
+       *
+       *  Returns a string representing groupings for the integer part of a
+       *  number.  This function is a hook for derived classes to change the
+       *  value returned.  @see grouping() for details.
+       *
+       *  @return  String representing grouping specification.
+      */
+      virtual string
+      do_grouping() const
+      { return _M_data->_M_grouping; }
+
+      /**
+       *  @brief  Return currency symbol string.
+       *
+       *  This function returns a string_type to use as a currency symbol.
+       *  This function is a hook for derived classes to change the value
+       *  returned.  @see curr_symbol() for details.
+       *
+       *  @return  @a string_type representing a currency symbol.
+      */
+      virtual string_type
+      do_curr_symbol()   const
+      { return _M_data->_M_curr_symbol; }
+
+      /**
+       *  @brief  Return positive sign string.
+       *
+       *  This function returns a string_type to use as a sign for positive
+       *  amounts.  This function is a hook for derived classes to change the
+       *  value returned.  @see positive_sign() for details.
+       *
+       *  @return  @a string_type representing a positive sign.
+      */
+      virtual string_type
+      do_positive_sign() const
+      { return _M_data->_M_positive_sign; }
+
+      /**
+       *  @brief  Return negative sign string.
+       *
+       *  This function returns a string_type to use as a sign for negative
+       *  amounts.  This function is a hook for derived classes to change the
+       *  value returned.  @see negative_sign() for details.
+       *
+       *  @return  @a string_type representing a negative sign.
+      */
+      virtual string_type
+      do_negative_sign() const
+      { return _M_data->_M_negative_sign; }
+
+      /**
+       *  @brief  Return number of digits in fraction.
+       *
+       *  This function returns the exact number of digits that make up the
+       *  fractional part of a money amount.  This function is a hook for
+       *  derived classes to change the value returned.  @see frac_digits()
+       *  for details.
+       *
+       *  @return  Number of digits in amount fraction.
+      */
+      virtual int
+      do_frac_digits() const
+      { return _M_data->_M_frac_digits; }
+
+      /**
+       *  @brief  Return pattern for money values.
+       *
+       *  This function returns a pattern describing the formatting of a
+       *  positive valued money amount.  This function is a hook for derived
+       *  classes to change the value returned.  @see pos_format() for
+       *  details.
+       *
+       *  @return  Pattern for money values.
+      */
+      virtual pattern
+      do_pos_format() const
+      { return _M_data->_M_pos_format; }
+
+      /**
+       *  @brief  Return pattern for money values.
+       *
+       *  This function returns a pattern describing the formatting of a
+       *  negative valued money amount.  This function is a hook for derived
+       *  classes to change the value returned.  @see neg_format() for
+       *  details.
+       *
+       *  @return  Pattern for money values.
+      */
+      virtual pattern
+      do_neg_format() const
+      { return _M_data->_M_neg_format; }
+
+      // For use at construction time only.
+       void
+       _M_initialize_moneypunct(__c_locale __cloc = 0,
+				const char* __name = 0);
+    };
+
+  template<typename _CharT, bool _Intl>
+    locale::id moneypunct<_CharT, _Intl>::id;
+
+  template<typename _CharT, bool _Intl>
+    const bool moneypunct<_CharT, _Intl>::intl;
+
+  template<>
+    moneypunct<char, true>::~moneypunct();
+
+  template<>
+    moneypunct<char, false>::~moneypunct();
+
+  template<>
+    void
+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);
+
+  template<>
+    void
+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    moneypunct<wchar_t, true>::~moneypunct();
+
+  template<>
+    moneypunct<wchar_t, false>::~moneypunct();
+
+  template<>
+    void
+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
+							const char*);
+
+  template<>
+    void
+    moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
+							 const char*);
+#endif
+
+  /// class moneypunct_byname [22.2.6.4].
+  template<typename _CharT, bool _Intl>
+    class moneypunct_byname : public moneypunct<_CharT, _Intl>
+    {
+    public:
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+
+      static const bool intl = _Intl;
+
+      explicit
+      moneypunct_byname(const char* __s, size_t __refs = 0)
+      : moneypunct<_CharT, _Intl>(__refs)
+      {
+	if (__builtin_strcmp(__s, "C") != 0
+	    && __builtin_strcmp(__s, "POSIX") != 0)
+	  {
+	    __c_locale __tmp;
+	    this->_S_create_c_locale(__tmp, __s);
+	    this->_M_initialize_moneypunct(__tmp);
+	    this->_S_destroy_c_locale(__tmp);
+	  }
+      }
+
+#if __cplusplus >= 201103L
+      explicit
+      moneypunct_byname(const string& __s, size_t __refs = 0)
+      : moneypunct_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~moneypunct_byname() { }
+    };
+
+  template<typename _CharT, bool _Intl>
+    const bool moneypunct_byname<_CharT, _Intl>::intl;
+
+_GLIBCXX_END_NAMESPACE_CXX11
+
+_GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
+
+  /**
+   *  @brief  Primary class template money_get.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to parse and return a monetary
+   *  amount from a string.
+   *
+   *  The money_get template uses protected virtual functions to
+   *  provide the actual results.  The public accessors forward the
+   *  call to the virtual functions.  These virtual functions are
+   *  hooks for developers to implement the behavior they require from
+   *  the money_get facet.
+  */
+  template<typename _CharT, typename _InIter>
+    class money_get : public locale::facet
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef _InIter			iter_type;
+      typedef basic_string<_CharT>	string_type;
+      //@}
+
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      money_get(size_t __refs = 0) : facet(__refs) { }
+
+      /**
+       *  @brief  Read and parse a monetary value.
+       *
+       *  This function reads characters from @a __s, interprets them as a
+       *  monetary value according to moneypunct and ctype facets retrieved
+       *  from io.getloc(), and returns the result in @a units as an integral
+       *  value moneypunct::frac_digits() * the actual amount.  For example,
+       *  the string $10.01 in a US locale would store 1001 in @a units.
+       *
+       *  Any characters not part of a valid money amount are not consumed.
+       *
+       *  If a money value cannot be parsed from the input stream, sets
+       *  err=(err|io.failbit).  If the stream is consumed before finishing
+       *  parsing,  sets err=(err|io.failbit|io.eofbit).  @a units is
+       *  unchanged if parsing fails.
+       *
+       *  This function works by returning the result of do_get().
+       *
+       *  @param  __s  Start of characters to parse.
+       *  @param  __end  End of characters to parse.
+       *  @param  __intl  Parameter to use_facet<moneypunct<CharT,intl> >.
+       *  @param  __io  Source of facets and io state.
+       *  @param  __err  Error field to set if parsing fails.
+       *  @param  __units  Place to store result of parsing.
+       *  @return  Iterator referencing first character beyond valid money
+       *	   amount.
+       */
+      iter_type
+      get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+	  ios_base::iostate& __err, long double& __units) const
+      { return this->do_get(__s, __end, __intl, __io, __err, __units); }
+
+      /**
+       *  @brief  Read and parse a monetary value.
+       *
+       *  This function reads characters from @a __s, interprets them as
+       *  a monetary value according to moneypunct and ctype facets
+       *  retrieved from io.getloc(), and returns the result in @a
+       *  digits.  For example, the string $10.01 in a US locale would
+       *  store <code>1001</code> in @a digits.
+       *
+       *  Any characters not part of a valid money amount are not consumed.
+       *
+       *  If a money value cannot be parsed from the input stream, sets
+       *  err=(err|io.failbit).  If the stream is consumed before finishing
+       *  parsing,  sets err=(err|io.failbit|io.eofbit).
+       *
+       *  This function works by returning the result of do_get().
+       *
+       *  @param  __s  Start of characters to parse.
+       *  @param  __end  End of characters to parse.
+       *  @param  __intl  Parameter to use_facet<moneypunct<CharT,intl> >.
+       *  @param  __io  Source of facets and io state.
+       *  @param  __err  Error field to set if parsing fails.
+       *  @param  __digits  Place to store result of parsing.
+       *  @return  Iterator referencing first character beyond valid money
+       *	   amount.
+       */
+      iter_type
+      get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+	  ios_base::iostate& __err, string_type& __digits) const
+      { return this->do_get(__s, __end, __intl, __io, __err, __digits); }
+
+    protected:
+      /// Destructor.
+      virtual
+      ~money_get() { }
+
+      /**
+       *  @brief  Read and parse a monetary value.
+       *
+       *  This function reads and parses characters representing a monetary
+       *  value.  This function is a hook for derived classes to change the
+       *  value returned.  @see get() for details.
+       */
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+      && _GLIBCXX_USE_CXX11_ABI == 0
+      virtual iter_type
+      __do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+	       ios_base::iostate& __err, double& __units) const;
+#else
+      virtual iter_type
+      do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+	     ios_base::iostate& __err, long double& __units) const;
+#endif
+
+      /**
+       *  @brief  Read and parse a monetary value.
+       *
+       *  This function reads and parses characters representing a monetary
+       *  value.  This function is a hook for derived classes to change the
+       *  value returned.  @see get() for details.
+       */
+      virtual iter_type
+      do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+	     ios_base::iostate& __err, string_type& __digits) const;
+
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+      && _GLIBCXX_USE_CXX11_ABI == 0
+      virtual iter_type
+      do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+	     ios_base::iostate& __err, long double& __units) const;
+#endif
+
+      template<bool _Intl>
+        iter_type
+        _M_extract(iter_type __s, iter_type __end, ios_base& __io,
+		   ios_base::iostate& __err, string& __digits) const;     
+    };
+
+  template<typename _CharT, typename _InIter>
+    locale::id money_get<_CharT, _InIter>::id;
+
+  /**
+   *  @brief  Primary class template money_put.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to format and output a monetary
+   *  amount.
+   *
+   *  The money_put template uses protected virtual functions to
+   *  provide the actual results.  The public accessors forward the
+   *  call to the virtual functions.  These virtual functions are
+   *  hooks for developers to implement the behavior they require from
+   *  the money_put facet.
+  */
+  template<typename _CharT, typename _OutIter>
+    class money_put : public locale::facet
+    {
+    public:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef _OutIter			iter_type;
+      typedef basic_string<_CharT>	string_type;
+      //@}
+
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      money_put(size_t __refs = 0) : facet(__refs) { }
+
+      /**
+       *  @brief  Format and output a monetary value.
+       *
+       *  This function formats @a units as a monetary value according to
+       *  moneypunct and ctype facets retrieved from io.getloc(), and writes
+       *  the resulting characters to @a __s.  For example, the value 1001 in a
+       *  US locale would write <code>$10.01</code> to @a __s.
+       *
+       *  This function works by returning the result of do_put().
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __intl  Parameter to use_facet<moneypunct<CharT,intl> >.
+       *  @param  __io  Source of facets and io state.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __units  Place to store result of parsing.
+       *  @return  Iterator after writing.
+       */
+      iter_type
+      put(iter_type __s, bool __intl, ios_base& __io,
+	  char_type __fill, long double __units) const
+      { return this->do_put(__s, __intl, __io, __fill, __units); }
+
+      /**
+       *  @brief  Format and output a monetary value.
+       *
+       *  This function formats @a digits as a monetary value
+       *  according to moneypunct and ctype facets retrieved from
+       *  io.getloc(), and writes the resulting characters to @a __s.
+       *  For example, the string <code>1001</code> in a US locale
+       *  would write <code>$10.01</code> to @a __s.
+       *
+       *  This function works by returning the result of do_put().
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __intl  Parameter to use_facet<moneypunct<CharT,intl> >.
+       *  @param  __io  Source of facets and io state.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __digits  Place to store result of parsing.
+       *  @return  Iterator after writing.
+       */
+      iter_type
+      put(iter_type __s, bool __intl, ios_base& __io,
+	  char_type __fill, const string_type& __digits) const
+      { return this->do_put(__s, __intl, __io, __fill, __digits); }
+
+    protected:
+      /// Destructor.
+      virtual
+      ~money_put() { }
+
+      /**
+       *  @brief  Format and output a monetary value.
+       *
+       *  This function formats @a units as a monetary value according to
+       *  moneypunct and ctype facets retrieved from io.getloc(), and writes
+       *  the resulting characters to @a __s.  For example, the value 1001 in a
+       *  US locale would write <code>$10.01</code> to @a __s.
+       *
+       *  This function is a hook for derived classes to change the value
+       *  returned.  @see put().
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __intl  Parameter to use_facet<moneypunct<CharT,intl> >.
+       *  @param  __io  Source of facets and io state.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __units  Place to store result of parsing.
+       *  @return  Iterator after writing.
+       */
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+      && _GLIBCXX_USE_CXX11_ABI == 0
+      virtual iter_type
+      __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	       double __units) const;
+#else
+      virtual iter_type
+      do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	     long double __units) const;
+#endif
+
+      /**
+       *  @brief  Format and output a monetary value.
+       *
+       *  This function formats @a digits as a monetary value
+       *  according to moneypunct and ctype facets retrieved from
+       *  io.getloc(), and writes the resulting characters to @a __s.
+       *  For example, the string <code>1001</code> in a US locale
+       *  would write <code>$10.01</code> to @a __s.
+       *
+       *  This function is a hook for derived classes to change the value
+       *  returned.  @see put().
+       *
+       *  @param  __s  The stream to write to.
+       *  @param  __intl  Parameter to use_facet<moneypunct<CharT,intl> >.
+       *  @param  __io  Source of facets and io state.
+       *  @param  __fill  char_type to use for padding.
+       *  @param  __digits  Place to store result of parsing.
+       *  @return  Iterator after writing.
+       */
+      virtual iter_type
+      do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	     const string_type& __digits) const;
+
+      // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+      && _GLIBCXX_USE_CXX11_ABI == 0
+      virtual iter_type
+      do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	     long double __units) const;
+#endif
+
+      template<bool _Intl>
+        iter_type
+        _M_insert(iter_type __s, ios_base& __io, char_type __fill,
+		  const string_type& __digits) const;
+    };
+
+  template<typename _CharT, typename _OutIter>
+    locale::id money_put<_CharT, _OutIter>::id;
+
+_GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
+
+  /**
+   *  @brief  Messages facet base class providing catalog typedef.
+   *  @ingroup locales
+   */
+  struct messages_base
+  {
+    typedef int catalog;
+  };
+
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+
+  /**
+   *  @brief  Primary class template messages.
+   *  @ingroup locales
+   *
+   *  This facet encapsulates the code to retrieve messages from
+   *  message catalogs.  The only thing defined by the standard for this facet
+   *  is the interface.  All underlying functionality is
+   *  implementation-defined.
+   *
+   *  This library currently implements 3 versions of the message facet.  The
+   *  first version (gnu) is a wrapper around gettext, provided by libintl.
+   *  The second version (ieee) is a wrapper around catgets.  The final
+   *  version (default) does no actual translation.  These implementations are
+   *  only provided for char and wchar_t instantiations.
+   *
+   *  The messages template uses protected virtual functions to
+   *  provide the actual results.  The public accessors forward the
+   *  call to the virtual functions.  These virtual functions are
+   *  hooks for developers to implement the behavior they require from
+   *  the messages facet.
+  */
+  template<typename _CharT>
+    class messages : public locale::facet, public messages_base
+    {
+    public:
+      // Types:
+      //@{
+      /// Public typedefs
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+      //@}
+
+    protected:
+      // Underlying "C" library locale information saved from
+      // initialization, needed by messages_byname as well.
+      __c_locale			_M_c_locale_messages;
+      const char*			_M_name_messages;
+
+    public:
+      /// Numpunct facet id.
+      static locale::id			id;
+
+      /**
+       *  @brief  Constructor performs initialization.
+       *
+       *  This is the constructor provided by the standard.
+       *
+       *  @param __refs  Passed to the base facet class.
+      */
+      explicit
+      messages(size_t __refs = 0);
+
+      // Non-standard.
+      /**
+       *  @brief  Internal constructor.  Not for general use.
+       *
+       *  This is a constructor for use by the library itself to set up new
+       *  locales.
+       *
+       *  @param  __cloc  The C locale.
+       *  @param  __s  The name of a locale.
+       *  @param  __refs  Refcount to pass to the base class.
+       */
+      explicit
+      messages(__c_locale __cloc, const char* __s, size_t __refs = 0);
+
+      /*
+       *  @brief  Open a message catalog.
+       *
+       *  This function opens and returns a handle to a message catalog by
+       *  returning do_open(__s, __loc).
+       *
+       *  @param  __s  The catalog to open.
+       *  @param  __loc  Locale to use for character set conversions.
+       *  @return  Handle to the catalog or value < 0 if open fails.
+      */
+      catalog
+      open(const basic_string<char>& __s, const locale& __loc) const
+      { return this->do_open(__s, __loc); }
+
+      // Non-standard and unorthodox, yet effective.
+      /*
+       *  @brief  Open a message catalog.
+       *
+       *  This non-standard function opens and returns a handle to a message
+       *  catalog by returning do_open(s, loc).  The third argument provides a
+       *  message catalog root directory for gnu gettext and is ignored
+       *  otherwise.
+       *
+       *  @param  __s  The catalog to open.
+       *  @param  __loc  Locale to use for character set conversions.
+       *  @param  __dir  Message catalog root directory.
+       *  @return  Handle to the catalog or value < 0 if open fails.
+      */
+      catalog
+      open(const basic_string<char>&, const locale&, const char*) const;
+
+      /*
+       *  @brief  Look up a string in a message catalog.
+       *
+       *  This function retrieves and returns a message from a catalog by
+       *  returning do_get(c, set, msgid, s).
+       *
+       *  For gnu, @a __set and @a msgid are ignored.  Returns gettext(s).
+       *  For default, returns s. For ieee, returns catgets(c,set,msgid,s).
+       *
+       *  @param  __c  The catalog to access.
+       *  @param  __set  Implementation-defined.
+       *  @param  __msgid  Implementation-defined.
+       *  @param  __s  Default return value if retrieval fails.
+       *  @return  Retrieved message or @a __s if get fails.
+      */
+      string_type
+      get(catalog __c, int __set, int __msgid, const string_type& __s) const
+      { return this->do_get(__c, __set, __msgid, __s); }
+
+      /*
+       *  @brief  Close a message catalog.
+       *
+       *  Closes catalog @a c by calling do_close(c).
+       *
+       *  @param  __c  The catalog to close.
+      */
+      void
+      close(catalog __c) const
+      { return this->do_close(__c); }
+
+    protected:
+      /// Destructor.
+      virtual
+      ~messages();
+
+      /*
+       *  @brief  Open a message catalog.
+       *
+       *  This function opens and returns a handle to a message catalog in an
+       *  implementation-defined manner.  This function is a hook for derived
+       *  classes to change the value returned.
+       *
+       *  @param  __s  The catalog to open.
+       *  @param  __loc  Locale to use for character set conversions.
+       *  @return  Handle to the opened catalog, value < 0 if open failed.
+      */
+      virtual catalog
+      do_open(const basic_string<char>&, const locale&) const;
+
+      /*
+       *  @brief  Look up a string in a message catalog.
+       *
+       *  This function retrieves and returns a message from a catalog in an
+       *  implementation-defined manner.  This function is a hook for derived
+       *  classes to change the value returned.
+       *
+       *  For gnu, @a __set and @a __msgid are ignored.  Returns gettext(s).
+       *  For default, returns s. For ieee, returns catgets(c,set,msgid,s).
+       *
+       *  @param  __c  The catalog to access.
+       *  @param  __set  Implementation-defined.
+       *  @param  __msgid  Implementation-defined.
+       *  @param  __s  Default return value if retrieval fails.
+       *  @return  Retrieved message or @a __s if get fails.
+      */
+      virtual string_type
+      do_get(catalog, int, int, const string_type& __dfault) const;
+
+      /*
+       *  @brief  Close a message catalog.
+       *
+       *  @param  __c  The catalog to close.
+      */
+      virtual void
+      do_close(catalog) const;
+
+      // Returns a locale and codeset-converted string, given a char* message.
+      char*
+      _M_convert_to_char(const string_type& __msg) const
+      {
+	// XXX
+	return reinterpret_cast<char*>(const_cast<_CharT*>(__msg.c_str()));
+      }
+
+      // Returns a locale and codeset-converted string, given a char* message.
+      string_type
+      _M_convert_from_char(char*) const
+      {
+	// XXX
+	return string_type();
+      }
+     };
+
+  template<typename _CharT>
+    locale::id messages<_CharT>::id;
+
+  /// Specializations for required instantiations.
+  template<>
+    string
+    messages<char>::do_get(catalog, int, int, const string&) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<>
+    wstring
+    messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
+#endif
+
+   /// class messages_byname [22.2.7.2].
+   template<typename _CharT>
+    class messages_byname : public messages<_CharT>
+    {
+    public:
+      typedef _CharT			char_type;
+      typedef basic_string<_CharT>	string_type;
+
+      explicit
+      messages_byname(const char* __s, size_t __refs = 0);
+
+#if __cplusplus >= 201103L
+      explicit
+      messages_byname(const string& __s, size_t __refs = 0)
+      : messages_byname(__s.c_str(), __refs) { }
+#endif
+
+    protected:
+      virtual
+      ~messages_byname()
+      { }
+    };
+
+_GLIBCXX_END_NAMESPACE_CXX11
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+// Include host and configuration specific messages functions.
+#include <bits/messages_members.h>
+
+// 22.2.1.5  Template class codecvt
+#include <bits/codecvt.h>
+
+#include <bits/locale_facets_nonio.tcc>
+
+#endif

+ 1507 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/locale_facets_nonio.tcc

@@ -0,0 +1,1507 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/locale_facets_nonio.tcc
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+#ifndef _LOCALE_FACETS_NONIO_TCC
+#define _LOCALE_FACETS_NONIO_TCC 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<typename _CharT, bool _Intl>
+    struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
+    {
+      const __moneypunct_cache<_CharT, _Intl>*
+      operator() (const locale& __loc) const
+      {
+	const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
+	const locale::facet** __caches = __loc._M_impl->_M_caches;
+	if (!__caches[__i])
+	  {
+	    __moneypunct_cache<_CharT, _Intl>* __tmp = 0;
+	    __try
+	      {
+		__tmp = new __moneypunct_cache<_CharT, _Intl>;
+		__tmp->_M_cache(__loc);
+	      }
+	    __catch(...)
+	      {
+		delete __tmp;
+		__throw_exception_again;
+	      }
+	    __loc._M_impl->_M_install_cache(__tmp, __i);
+	  }
+	return static_cast<
+	  const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]);
+      }
+    };
+
+  template<typename _CharT, bool _Intl>
+    void
+    __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc)
+    {
+      const moneypunct<_CharT, _Intl>& __mp =
+	use_facet<moneypunct<_CharT, _Intl> >(__loc);
+
+      _M_decimal_point = __mp.decimal_point();
+      _M_thousands_sep = __mp.thousands_sep();
+      _M_frac_digits = __mp.frac_digits();
+
+      char* __grouping = 0;
+      _CharT* __curr_symbol = 0;
+      _CharT* __positive_sign = 0;
+      _CharT* __negative_sign = 0;     
+      __try
+	{
+	  const string& __g = __mp.grouping();
+	  _M_grouping_size = __g.size();
+	  __grouping = new char[_M_grouping_size];
+	  __g.copy(__grouping, _M_grouping_size);
+	  _M_use_grouping = (_M_grouping_size
+			     && static_cast<signed char>(__grouping[0]) > 0
+			     && (__grouping[0]
+				 != __gnu_cxx::__numeric_traits<char>::__max));
+
+	  const basic_string<_CharT>& __cs = __mp.curr_symbol();
+	  _M_curr_symbol_size = __cs.size();
+	  __curr_symbol = new _CharT[_M_curr_symbol_size];
+	  __cs.copy(__curr_symbol, _M_curr_symbol_size);
+
+	  const basic_string<_CharT>& __ps = __mp.positive_sign();
+	  _M_positive_sign_size = __ps.size();
+	  __positive_sign = new _CharT[_M_positive_sign_size];
+	  __ps.copy(__positive_sign, _M_positive_sign_size);
+
+	  const basic_string<_CharT>& __ns = __mp.negative_sign();
+	  _M_negative_sign_size = __ns.size();
+	  __negative_sign = new _CharT[_M_negative_sign_size];
+	  __ns.copy(__negative_sign, _M_negative_sign_size);
+
+	  _M_pos_format = __mp.pos_format();
+	  _M_neg_format = __mp.neg_format();
+
+	  const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+	  __ct.widen(money_base::_S_atoms,
+		     money_base::_S_atoms + money_base::_S_end, _M_atoms);
+
+	  _M_grouping = __grouping;
+	  _M_curr_symbol = __curr_symbol;
+	  _M_positive_sign = __positive_sign;
+	  _M_negative_sign = __negative_sign;
+	  _M_allocated = true;
+	}
+      __catch(...)
+	{
+	  delete [] __grouping;
+	  delete [] __curr_symbol;
+	  delete [] __positive_sign;
+	  delete [] __negative_sign;
+	  __throw_exception_again;
+	}
+    }
+
+_GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
+
+  template<typename _CharT, typename _InIter>
+    template<bool _Intl>
+      _InIter
+      money_get<_CharT, _InIter>::
+      _M_extract(iter_type __beg, iter_type __end, ios_base& __io,
+		 ios_base::iostate& __err, string& __units) const
+      {
+	typedef char_traits<_CharT>			  __traits_type;
+	typedef typename string_type::size_type	          size_type;	
+	typedef money_base::part			  part;
+	typedef __moneypunct_cache<_CharT, _Intl>         __cache_type;
+	
+	const locale& __loc = __io._M_getloc();
+	const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+	__use_cache<__cache_type> __uc;
+	const __cache_type* __lc = __uc(__loc);
+	const char_type* __lit = __lc->_M_atoms;
+
+	// Deduced sign.
+	bool __negative = false;
+	// Sign size.
+	size_type __sign_size = 0;
+	// True if sign is mandatory.
+	const bool __mandatory_sign = (__lc->_M_positive_sign_size
+				       && __lc->_M_negative_sign_size);
+	// String of grouping info from thousands_sep plucked from __units.
+	string __grouping_tmp;
+	if (__lc->_M_use_grouping)
+	  __grouping_tmp.reserve(32);
+	// Last position before the decimal point.
+	int __last_pos = 0;
+	// Separator positions, then, possibly, fractional digits.
+	int __n = 0;
+	// If input iterator is in a valid state.
+	bool __testvalid = true;
+	// Flag marking when a decimal point is found.
+	bool __testdecfound = false;
+
+	// The tentative returned string is stored here.
+	string __res;
+	__res.reserve(32);
+
+	const char_type* __lit_zero = __lit + money_base::_S_zero;
+	const money_base::pattern __p = __lc->_M_neg_format;
+	for (int __i = 0; __i < 4 && __testvalid; ++__i)
+	  {
+	    const part __which = static_cast<part>(__p.field[__i]);
+	    switch (__which)
+	      {
+	      case money_base::symbol:
+		// According to 22.2.6.1.2, p2, symbol is required
+		// if (__io.flags() & ios_base::showbase), otherwise
+		// is optional and consumed only if other characters
+		// are needed to complete the format.
+		if (__io.flags() & ios_base::showbase || __sign_size > 1
+		    || __i == 0
+		    || (__i == 1 && (__mandatory_sign
+				     || (static_cast<part>(__p.field[0])
+					 == money_base::sign)
+				     || (static_cast<part>(__p.field[2])
+					 == money_base::space)))
+		    || (__i == 2 && ((static_cast<part>(__p.field[3])
+				      == money_base::value)
+				     || (__mandatory_sign
+					 && (static_cast<part>(__p.field[3])
+					     == money_base::sign)))))
+		  {
+		    const size_type __len = __lc->_M_curr_symbol_size;
+		    size_type __j = 0;
+		    for (; __beg != __end && __j < __len
+			   && *__beg == __lc->_M_curr_symbol[__j];
+			 ++__beg, (void)++__j);
+		    if (__j != __len
+			&& (__j || __io.flags() & ios_base::showbase))
+		      __testvalid = false;
+		  }
+		break;
+	      case money_base::sign:
+		// Sign might not exist, or be more than one character long.
+		if (__lc->_M_positive_sign_size && __beg != __end
+		    && *__beg == __lc->_M_positive_sign[0])
+		  {
+		    __sign_size = __lc->_M_positive_sign_size;
+		    ++__beg;
+		  }
+		else if (__lc->_M_negative_sign_size && __beg != __end
+			 && *__beg == __lc->_M_negative_sign[0])
+		  {
+		    __negative = true;
+		    __sign_size = __lc->_M_negative_sign_size;
+		    ++__beg;
+		  }
+		else if (__lc->_M_positive_sign_size
+			 && !__lc->_M_negative_sign_size)
+		  // "... if no sign is detected, the result is given the sign
+		  // that corresponds to the source of the empty string"
+		  __negative = true;
+		else if (__mandatory_sign)
+		  __testvalid = false;
+		break;
+	      case money_base::value:
+		// Extract digits, remove and stash away the
+		// grouping of found thousands separators.
+		for (; __beg != __end; ++__beg)
+		  {
+		    const char_type __c = *__beg;
+		    const char_type* __q = __traits_type::find(__lit_zero, 
+							       10, __c);
+		    if (__q != 0)
+		      {
+			__res += money_base::_S_atoms[__q - __lit];
+			++__n;
+		      }
+		    else if (__c == __lc->_M_decimal_point 
+			     && !__testdecfound)
+		      {
+			if (__lc->_M_frac_digits <= 0)
+			  break;
+
+			__last_pos = __n;
+			__n = 0;
+			__testdecfound = true;
+		      }
+		    else if (__lc->_M_use_grouping
+			     && __c == __lc->_M_thousands_sep
+			     && !__testdecfound)
+		      {
+			if (__n)
+			  {
+			    // Mark position for later analysis.
+			    __grouping_tmp += static_cast<char>(__n);
+			    __n = 0;
+			  }
+			else
+			  {
+			    __testvalid = false;
+			    break;
+			  }
+		      }
+		    else
+		      break;
+		  }
+		if (__res.empty())
+		  __testvalid = false;
+		break;
+	      case money_base::space:
+		// At least one space is required.
+		if (__beg != __end && __ctype.is(ctype_base::space, *__beg))
+		  ++__beg;
+		else
+		  __testvalid = false;
+	      case money_base::none:
+		// Only if not at the end of the pattern.
+		if (__i != 3)
+		  for (; __beg != __end
+			 && __ctype.is(ctype_base::space, *__beg); ++__beg);
+		break;
+	      }
+	  }
+
+	// Need to get the rest of the sign characters, if they exist.
+	if (__sign_size > 1 && __testvalid)
+	  {
+	    const char_type* __sign = __negative ? __lc->_M_negative_sign
+	                                         : __lc->_M_positive_sign;
+	    size_type __i = 1;
+	    for (; __beg != __end && __i < __sign_size
+		   && *__beg == __sign[__i]; ++__beg, (void)++__i);
+	    
+	    if (__i != __sign_size)
+	      __testvalid = false;
+	  }
+
+	if (__testvalid)
+	  {
+	    // Strip leading zeros.
+	    if (__res.size() > 1)
+	      {
+		const size_type __first = __res.find_first_not_of('0');
+		const bool __only_zeros = __first == string::npos;
+		if (__first)
+		  __res.erase(0, __only_zeros ? __res.size() - 1 : __first);
+	      }
+
+	    // 22.2.6.1.2, p4
+	    if (__negative && __res[0] != '0')
+	      __res.insert(__res.begin(), '-');
+	    
+	    // Test for grouping fidelity.
+	    if (__grouping_tmp.size())
+	      {
+		// Add the ending grouping.
+		__grouping_tmp += static_cast<char>(__testdecfound ? __last_pos
+						                   : __n);
+		if (!std::__verify_grouping(__lc->_M_grouping,
+					    __lc->_M_grouping_size,
+					    __grouping_tmp))
+		  __err |= ios_base::failbit;
+	      }
+	    
+	    // Iff not enough digits were supplied after the decimal-point.
+	    if (__testdecfound && __n != __lc->_M_frac_digits)
+	      __testvalid = false;
+	  }
+
+	// Iff valid sequence is not recognized.
+	if (!__testvalid)
+	  __err |= ios_base::failbit;
+	else
+	  __units.swap(__res);
+	
+	// Iff no more characters are available.
+	if (__beg == __end)
+	  __err |= ios_base::eofbit;
+	return __beg;
+      }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+      && _GLIBCXX_USE_CXX11_ABI == 0
+  template<typename _CharT, typename _InIter>
+    _InIter
+    money_get<_CharT, _InIter>::
+    __do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+	     ios_base::iostate& __err, double& __units) const
+    {
+      string __str;
+      __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+                     : _M_extract<false>(__beg, __end, __io, __err, __str);
+      std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
+      return __beg;
+    }
+#endif
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    money_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+	   ios_base::iostate& __err, long double& __units) const
+    {
+      string __str;
+      __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+	             : _M_extract<false>(__beg, __end, __io, __err, __str);
+      std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    money_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+	   ios_base::iostate& __err, string_type& __digits) const
+    {
+      typedef typename string::size_type                  size_type;
+
+      const locale& __loc = __io._M_getloc();
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+      string __str;
+      __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+	             : _M_extract<false>(__beg, __end, __io, __err, __str);
+      const size_type __len = __str.size();
+      if (__len)
+	{
+	  __digits.resize(__len);
+	  __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]);
+	}
+      return __beg;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    template<bool _Intl>
+      _OutIter
+      money_put<_CharT, _OutIter>::
+      _M_insert(iter_type __s, ios_base& __io, char_type __fill,
+		const string_type& __digits) const
+      {
+	typedef typename string_type::size_type	          size_type;
+	typedef money_base::part                          part;
+	typedef __moneypunct_cache<_CharT, _Intl>         __cache_type;
+      
+	const locale& __loc = __io._M_getloc();
+	const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+	__use_cache<__cache_type> __uc;
+	const __cache_type* __lc = __uc(__loc);
+	const char_type* __lit = __lc->_M_atoms;
+
+	// Determine if negative or positive formats are to be used, and
+	// discard leading negative_sign if it is present.
+	const char_type* __beg = __digits.data();
+
+	money_base::pattern __p;
+	const char_type* __sign;
+	size_type __sign_size;
+	if (!(*__beg == __lit[money_base::_S_minus]))
+	  {
+	    __p = __lc->_M_pos_format;
+	    __sign = __lc->_M_positive_sign;
+	    __sign_size = __lc->_M_positive_sign_size;
+	  }
+	else
+	  {
+	    __p = __lc->_M_neg_format;
+	    __sign = __lc->_M_negative_sign;
+	    __sign_size = __lc->_M_negative_sign_size;
+	    if (__digits.size())
+	      ++__beg;
+	  }
+       
+	// Look for valid numbers in the ctype facet within input digits.
+	size_type __len = __ctype.scan_not(ctype_base::digit, __beg,
+					   __beg + __digits.size()) - __beg;
+	if (__len)
+	  {
+	    // Assume valid input, and attempt to format.
+	    // Break down input numbers into base components, as follows:
+	    //   final_value = grouped units + (decimal point) + (digits)
+	    string_type __value;
+	    __value.reserve(2 * __len);
+
+	    // Add thousands separators to non-decimal digits, per
+	    // grouping rules.
+	    long __paddec = __len - __lc->_M_frac_digits;
+	    if (__paddec > 0)
+  	      {
+		if (__lc->_M_frac_digits < 0)
+		  __paddec = __len;
+  		if (__lc->_M_grouping_size)
+  		  {
+		    __value.assign(2 * __paddec, char_type());
+ 		    _CharT* __vend = 
+		      std::__add_grouping(&__value[0], __lc->_M_thousands_sep,
+					  __lc->_M_grouping,
+					  __lc->_M_grouping_size,
+					  __beg, __beg + __paddec);
+		    __value.erase(__vend - &__value[0]);
+  		  }
+  		else
+		  __value.assign(__beg, __paddec);
+	      }
+
+	    // Deal with decimal point, decimal digits.
+	    if (__lc->_M_frac_digits > 0)
+	      {
+		__value += __lc->_M_decimal_point;
+		if (__paddec >= 0)
+		  __value.append(__beg + __paddec, __lc->_M_frac_digits);
+		else
+		  {
+		    // Have to pad zeros in the decimal position.
+		    __value.append(-__paddec, __lit[money_base::_S_zero]);
+		    __value.append(__beg, __len);
+		  }
+  	      }
+  
+	    // Calculate length of resulting string.
+	    const ios_base::fmtflags __f = __io.flags() 
+	                                   & ios_base::adjustfield;
+	    __len = __value.size() + __sign_size;
+	    __len += ((__io.flags() & ios_base::showbase)
+		      ? __lc->_M_curr_symbol_size : 0);
+
+	    string_type __res;
+	    __res.reserve(2 * __len);
+	    
+	    const size_type __width = static_cast<size_type>(__io.width());  
+	    const bool __testipad = (__f == ios_base::internal
+				     && __len < __width);
+	    // Fit formatted digits into the required pattern.
+	    for (int __i = 0; __i < 4; ++__i)
+	      {
+		const part __which = static_cast<part>(__p.field[__i]);
+		switch (__which)
+		  {
+		  case money_base::symbol:
+		    if (__io.flags() & ios_base::showbase)
+		      __res.append(__lc->_M_curr_symbol,
+				   __lc->_M_curr_symbol_size);
+		    break;
+		  case money_base::sign:
+		    // Sign might not exist, or be more than one
+		    // character long. In that case, add in the rest
+		    // below.
+		    if (__sign_size)
+		      __res += __sign[0];
+		    break;
+		  case money_base::value:
+		    __res += __value;
+		    break;
+		  case money_base::space:
+		    // At least one space is required, but if internal
+		    // formatting is required, an arbitrary number of
+		    // fill spaces will be necessary.
+		    if (__testipad)
+		      __res.append(__width - __len, __fill);
+		    else
+		      __res += __fill;
+		    break;
+		  case money_base::none:
+		    if (__testipad)
+		      __res.append(__width - __len, __fill);
+		    break;
+		  }
+	      }
+	    
+	    // Special case of multi-part sign parts.
+	    if (__sign_size > 1)
+	      __res.append(__sign + 1, __sign_size - 1);
+	    
+	    // Pad, if still necessary.
+	    __len = __res.size();
+	    if (__width > __len)
+	      {
+		if (__f == ios_base::left)
+		  // After.
+		  __res.append(__width - __len, __fill);
+		else
+		  // Before.
+		  __res.insert(0, __width - __len, __fill);
+		__len = __width;
+	      }
+	    
+	    // Write resulting, fully-formatted string to output iterator.
+	    __s = std::__write(__s, __res.data(), __len);
+	  }
+	__io.width(0);
+	return __s;    
+      }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+      && _GLIBCXX_USE_CXX11_ABI == 0
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    money_put<_CharT, _OutIter>::
+    __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	     double __units) const
+    { return this->do_put(__s, __intl, __io, __fill, (long double) __units); }
+#endif
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    money_put<_CharT, _OutIter>::
+    do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	   long double __units) const
+    {
+      const locale __loc = __io.getloc();
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+#if _GLIBCXX_USE_C99_STDIO
+      // First try a buffer perhaps big enough.
+      int __cs_size = 64;
+      char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 328. Bad sprintf format modifier in money_put<>::do_put()
+      int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+					"%.*Lf", 0, __units);
+      // If the buffer was not large enough, try again with the correct size.
+      if (__len >= __cs_size)
+	{
+	  __cs_size = __len + 1;
+	  __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+	  __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+					"%.*Lf", 0, __units);
+	}
+#else
+      // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
+      const int __cs_size =
+	__gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 3;
+      char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+      int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf", 
+					0, __units);
+#endif
+      string_type __digits(__len, char_type());
+      __ctype.widen(__cs, __cs + __len, &__digits[0]);
+      return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
+	            : _M_insert<false>(__s, __io, __fill, __digits);
+    }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    money_put<_CharT, _OutIter>::
+    do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+	   const string_type& __digits) const
+    { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
+	            : _M_insert<false>(__s, __io, __fill, __digits); }
+
+_GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
+
+  // NB: Not especially useful. Without an ios_base object or some
+  // kind of locale reference, we are left clawing at the air where
+  // the side of the mountain used to be...
+  template<typename _CharT, typename _InIter>
+    time_base::dateorder
+    time_get<_CharT, _InIter>::do_date_order() const
+    { return time_base::no_order; }
+
+  // Expand a strftime format string and parse it.  E.g., do_get_date() may
+  // pass %m/%d/%Y => extracted characters.
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
+			  ios_base::iostate& __err, tm* __tm,
+			  const _CharT* __format) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+      const size_t __len = char_traits<_CharT>::length(__format);
+
+      ios_base::iostate __tmperr = ios_base::goodbit;
+      size_t __i = 0;
+      for (; __beg != __end && __i < __len && !__tmperr; ++__i)
+	{
+	  if (__ctype.narrow(__format[__i], 0) == '%')
+	    {
+	      // Verify valid formatting code, attempt to extract.
+	      char __c = __ctype.narrow(__format[++__i], 0);
+	      int __mem = 0;
+	      if (__c == 'E' || __c == 'O')
+		__c = __ctype.narrow(__format[++__i], 0);
+	      switch (__c)
+		{
+		  const char* __cs;
+		  _CharT __wcs[10];
+		case 'a':
+		  // Abbreviated weekday name [tm_wday]
+		  const char_type*  __days1[7];
+		  __tp._M_days_abbreviated(__days1);
+		  __beg = _M_extract_name(__beg, __end, __mem, __days1,
+					  7, __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_wday = __mem;
+		  break;
+		case 'A':
+		  // Weekday name [tm_wday].
+		  const char_type*  __days2[7];
+		  __tp._M_days(__days2);
+		  __beg = _M_extract_name(__beg, __end, __mem, __days2,
+					  7, __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_wday = __mem;
+		  break;
+		case 'h':
+		case 'b':
+		  // Abbreviated month name [tm_mon]
+		  const char_type*  __months1[12];
+		  __tp._M_months_abbreviated(__months1);
+		  __beg = _M_extract_name(__beg, __end, __mem,
+					  __months1, 12, __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_mon = __mem;
+		  break;
+		case 'B':
+		  // Month name [tm_mon].
+		  const char_type*  __months2[12];
+		  __tp._M_months(__months2);
+		  __beg = _M_extract_name(__beg, __end, __mem,
+					  __months2, 12, __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_mon = __mem;
+		  break;
+		case 'c':
+		  // Default time and date representation.
+		  const char_type*  __dt[2];
+		  __tp._M_date_time_formats(__dt);
+		  __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, 
+						__tm, __dt[0]);
+		  break;
+		case 'd':
+		  // Day [01, 31]. [tm_mday]
+		  __beg = _M_extract_num(__beg, __end, __mem, 1, 31, 2,
+					 __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_mday = __mem;
+		  break;
+		case 'e':
+		  // Day [1, 31], with single digits preceded by
+		  // space. [tm_mday]
+		  if (__ctype.is(ctype_base::space, *__beg))
+		    __beg = _M_extract_num(++__beg, __end, __mem, 1, 9,
+					   1, __io, __tmperr);
+		  else
+		    __beg = _M_extract_num(__beg, __end, __mem, 10, 31,
+					   2, __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_mday = __mem;
+		  break;
+		case 'D':
+		  // Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year]
+		  __cs = "%m/%d/%y";
+		  __ctype.widen(__cs, __cs + 9, __wcs);
+		  __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, 
+						__tm, __wcs);
+		  break;
+		case 'H':
+		  // Hour [00, 23]. [tm_hour]
+		  __beg = _M_extract_num(__beg, __end, __mem, 0, 23, 2,
+					 __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_hour = __mem;
+		  break;
+		case 'I':
+		  // Hour [01, 12]. [tm_hour]
+		  __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2,
+					 __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_hour = __mem;
+		  break;
+		case 'm':
+		  // Month [01, 12]. [tm_mon]
+		  __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2, 
+					 __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_mon = __mem - 1;
+		  break;
+		case 'M':
+		  // Minute [00, 59]. [tm_min]
+		  __beg = _M_extract_num(__beg, __end, __mem, 0, 59, 2,
+					 __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_min = __mem;
+		  break;
+		case 'n':
+		  if (__ctype.narrow(*__beg, 0) == '\n')
+		    ++__beg;
+		  else
+		    __tmperr |= ios_base::failbit;
+		  break;
+		case 'R':
+		  // Equivalent to (%H:%M).
+		  __cs = "%H:%M";
+		  __ctype.widen(__cs, __cs + 6, __wcs);
+		  __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, 
+						__tm, __wcs);
+		  break;
+		case 'S':
+		  // Seconds. [tm_sec]
+		  // [00, 60] in C99 (one leap-second), [00, 61] in C89.
+#if _GLIBCXX_USE_C99
+		  __beg = _M_extract_num(__beg, __end, __mem, 0, 60, 2,
+#else
+		  __beg = _M_extract_num(__beg, __end, __mem, 0, 61, 2,
+#endif
+					 __io, __tmperr);
+		  if (!__tmperr)
+		  __tm->tm_sec = __mem;
+		  break;
+		case 't':
+		  if (__ctype.narrow(*__beg, 0) == '\t')
+		    ++__beg;
+		  else
+		    __tmperr |= ios_base::failbit;
+		  break;
+		case 'T':
+		  // Equivalent to (%H:%M:%S).
+		  __cs = "%H:%M:%S";
+		  __ctype.widen(__cs, __cs + 9, __wcs);
+		  __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, 
+						__tm, __wcs);
+		  break;
+		case 'x':
+		  // Locale's date.
+		  const char_type*  __dates[2];
+		  __tp._M_date_formats(__dates);
+		  __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, 
+						__tm, __dates[0]);
+		  break;
+		case 'X':
+		  // Locale's time.
+		  const char_type*  __times[2];
+		  __tp._M_time_formats(__times);
+		  __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, 
+						__tm, __times[0]);
+		  break;
+		case 'y':
+		case 'C': // C99
+		  // Two digit year.
+		case 'Y':
+		  // Year [1900).
+		  // NB: We parse either two digits, implicitly years since
+		  // 1900, or 4 digits, full year.  In both cases we can 
+		  // reconstruct [tm_year].  See also libstdc++/26701.
+		  __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
+					 __io, __tmperr);
+		  if (!__tmperr)
+		    __tm->tm_year = __mem < 0 ? __mem + 100 : __mem - 1900;
+		  break;
+		case 'Z':
+		  // Timezone info.
+		  if (__ctype.is(ctype_base::upper, *__beg))
+		    {
+		      int __tmp;
+		      __beg = _M_extract_name(__beg, __end, __tmp,
+				       __timepunct_cache<_CharT>::_S_timezones,
+					      14, __io, __tmperr);
+
+		      // GMT requires special effort.
+		      if (__beg != __end && !__tmperr && __tmp == 0
+			  && (*__beg == __ctype.widen('-')
+			      || *__beg == __ctype.widen('+')))
+			{
+			  __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2,
+						 __io, __tmperr);
+			  __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2,
+						 __io, __tmperr);
+			}
+		    }
+		  else
+		    __tmperr |= ios_base::failbit;
+		  break;
+		default:
+		  // Not recognized.
+		  __tmperr |= ios_base::failbit;
+		}
+	    }
+	  else
+	    {
+	      // Verify format and input match, extract and discard.
+	      if (__format[__i] == *__beg)
+		++__beg;
+	      else
+		__tmperr |= ios_base::failbit;
+	    }
+	}
+
+      if (__tmperr || __i != __len)
+	__err |= ios_base::failbit;
+  
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    _M_extract_num(iter_type __beg, iter_type __end, int& __member,
+		   int __min, int __max, size_t __len,
+		   ios_base& __io, ios_base::iostate& __err) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+      // As-is works for __len = 1, 2, 4, the values actually used.
+      int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);
+
+      ++__min;
+      size_t __i = 0;
+      int __value = 0;
+      for (; __beg != __end && __i < __len; ++__beg, (void)++__i)
+	{
+	  const char __c = __ctype.narrow(*__beg, '*');
+	  if (__c >= '0' && __c <= '9')
+	    {
+	      __value = __value * 10 + (__c - '0');
+	      const int __valuec = __value * __mult;
+	      if (__valuec > __max || __valuec + __mult < __min)
+		break;
+	      __mult /= 10;
+	    }
+	  else
+	    break;
+	}
+      if (__i == __len)
+	__member = __value;
+      // Special encoding for do_get_year, 'y', and 'Y' above.
+      else if (__len == 4 && __i == 2)
+	__member = __value - 100;
+      else
+	__err |= ios_base::failbit;
+
+      return __beg;
+    }
+
+  // Assumptions:
+  // All elements in __names are unique.
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    _M_extract_name(iter_type __beg, iter_type __end, int& __member,
+		    const _CharT** __names, size_t __indexlen,
+		    ios_base& __io, ios_base::iostate& __err) const
+    {
+      typedef char_traits<_CharT>		__traits_type;
+      const locale& __loc = __io._M_getloc();
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+      int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int)
+							  * __indexlen));
+      size_t __nmatches = 0;
+      size_t __pos = 0;
+      bool __testvalid = true;
+      const char_type* __name;
+
+      // Look for initial matches.
+      // NB: Some of the locale data is in the form of all lowercase
+      // names, and some is in the form of initially-capitalized
+      // names. Look for both.
+      if (__beg != __end)
+	{
+	  const char_type __c = *__beg;
+	  for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
+	    if (__c == __names[__i1][0]
+		|| __c == __ctype.toupper(__names[__i1][0]))
+	      __matches[__nmatches++] = __i1;
+	}
+
+      while (__nmatches > 1)
+	{
+	  // Find smallest matching string.
+	  size_t __minlen = __traits_type::length(__names[__matches[0]]);
+	  for (size_t __i2 = 1; __i2 < __nmatches; ++__i2)
+	    __minlen = std::min(__minlen,
+			      __traits_type::length(__names[__matches[__i2]]));
+	  ++__beg;
+	  ++__pos;
+	  if (__pos < __minlen && __beg != __end)
+	    for (size_t __i3 = 0; __i3 < __nmatches;)
+	      {
+		__name = __names[__matches[__i3]];
+		if (!(__name[__pos] == *__beg))
+		  __matches[__i3] = __matches[--__nmatches];
+		else
+		  ++__i3;
+	      }
+	  else
+	    break;
+	}
+
+      if (__nmatches == 1)
+	{
+	  // Make sure found name is completely extracted.
+	  ++__beg;
+	  ++__pos;
+	  __name = __names[__matches[0]];
+	  const size_t __len = __traits_type::length(__name);
+	  while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
+	    ++__beg, (void)++__pos;
+
+	  if (__len == __pos)
+	    __member = __matches[0];
+	  else
+	    __testvalid = false;
+	}
+      else
+	__testvalid = false;
+      if (!__testvalid)
+	__err |= ios_base::failbit;
+
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    _M_extract_wday_or_month(iter_type __beg, iter_type __end, int& __member,
+			     const _CharT** __names, size_t __indexlen,
+			     ios_base& __io, ios_base::iostate& __err) const
+    {
+      typedef char_traits<_CharT>		__traits_type;
+      const locale& __loc = __io._M_getloc();
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+      int* __matches = static_cast<int*>(__builtin_alloca(2 * sizeof(int)
+							  * __indexlen));
+      size_t __nmatches = 0;
+      size_t* __matches_lengths = 0;
+      size_t __pos = 0;
+
+      if (__beg != __end)
+	{
+	  const char_type __c = *__beg;
+	  for (size_t __i = 0; __i < 2 * __indexlen; ++__i)
+	    if (__c == __names[__i][0]
+		|| __c == __ctype.toupper(__names[__i][0]))
+	      __matches[__nmatches++] = __i;
+	}
+
+      if (__nmatches)
+	{
+	  ++__beg;
+	  ++__pos;
+
+	  __matches_lengths
+	    = static_cast<size_t*>(__builtin_alloca(sizeof(size_t)
+						    * __nmatches));
+	  for (size_t __i = 0; __i < __nmatches; ++__i)
+	    __matches_lengths[__i]
+	      = __traits_type::length(__names[__matches[__i]]);
+	}
+
+      for (; __beg != __end; ++__beg, (void)++__pos)
+	{
+	  size_t __nskipped = 0;
+	  const char_type __c = *__beg;
+	  for (size_t __i = 0; __i < __nmatches;)
+	    {
+	      const char_type* __name = __names[__matches[__i]];
+	      if (__pos >= __matches_lengths[__i])
+		++__nskipped, ++__i;
+	      else if (!(__name[__pos] == __c))
+		{
+		  --__nmatches;
+		  __matches[__i] = __matches[__nmatches];
+		  __matches_lengths[__i] = __matches_lengths[__nmatches];
+		}
+	      else
+		++__i;
+	    }
+	  if (__nskipped == __nmatches)
+	    break;
+	}
+
+      if ((__nmatches == 1 && __matches_lengths[0] == __pos)
+	  || (__nmatches == 2 && (__matches_lengths[0] == __pos
+				  || __matches_lengths[1] == __pos)))
+	__member = (__matches[0] >= __indexlen
+		    ? __matches[0] - __indexlen : __matches[0]);
+      else
+	__err |= ios_base::failbit;
+
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
+		ios_base::iostate& __err, tm* __tm) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+      const char_type*  __times[2];
+      __tp._M_time_formats(__times);
+      __beg = _M_extract_via_format(__beg, __end, __io, __err, 
+				    __tm, __times[0]);
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
+		ios_base::iostate& __err, tm* __tm) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+      const char_type*  __dates[2];
+      __tp._M_date_formats(__dates);
+      __beg = _M_extract_via_format(__beg, __end, __io, __err, 
+				    __tm, __dates[0]);
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
+		   ios_base::iostate& __err, tm* __tm) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+      const char_type* __days[14];
+      __tp._M_days_abbreviated(__days);
+      __tp._M_days(__days + 7);
+      int __tmpwday;
+      ios_base::iostate __tmperr = ios_base::goodbit;
+
+      __beg = _M_extract_wday_or_month(__beg, __end, __tmpwday, __days, 7,
+				       __io, __tmperr);
+      if (!__tmperr)
+	__tm->tm_wday = __tmpwday;
+      else
+	__err |= ios_base::failbit;
+
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+     }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    do_get_monthname(iter_type __beg, iter_type __end,
+                     ios_base& __io, ios_base::iostate& __err, tm* __tm) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+      const char_type*  __months[24];
+      __tp._M_months_abbreviated(__months);
+      __tp._M_months(__months + 12);
+      int __tmpmon;
+      ios_base::iostate __tmperr = ios_base::goodbit;
+
+      __beg = _M_extract_wday_or_month(__beg, __end, __tmpmon, __months, 12,
+				       __io, __tmperr);
+      if (!__tmperr)
+	__tm->tm_mon = __tmpmon;
+      else
+	__err |= ios_base::failbit;
+
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    time_get<_CharT, _InIter>::
+    do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
+		ios_base::iostate& __err, tm* __tm) const
+    {
+      const locale& __loc = __io._M_getloc();
+      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+      int __tmpyear;
+      ios_base::iostate __tmperr = ios_base::goodbit;
+
+      __beg = _M_extract_num(__beg, __end, __tmpyear, 0, 9999, 4,
+			     __io, __tmperr);
+      if (!__tmperr)
+	__tm->tm_year = __tmpyear < 0 ? __tmpyear + 100 : __tmpyear - 1900;
+      else
+	__err |= ios_base::failbit;
+
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+#if __cplusplus >= 201103L
+  template<typename _CharT, typename _InIter>
+    inline
+    _InIter
+    time_get<_CharT, _InIter>::
+    get(iter_type __s, iter_type __end, ios_base& __io,
+        ios_base::iostate& __err, tm* __tm, const char_type* __fmt,
+        const char_type* __fmtend) const
+    {
+      const locale& __loc = __io._M_getloc();
+      ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+      __err = ios_base::goodbit;
+      while (__fmt != __fmtend &&
+             __err == ios_base::goodbit)
+        {
+          if (__s == __end)
+            {
+              __err = ios_base::eofbit | ios_base::failbit;
+              break;
+            }
+          else if (__ctype.narrow(*__fmt, 0) == '%')
+            {
+              char __format;
+              char __mod = 0;
+              if (++__fmt == __fmtend)
+                {
+                  __err = ios_base::failbit;
+                  break;
+                }
+              const char __c = __ctype.narrow(*__fmt, 0);
+              if (__c != 'E' && __c != 'O')
+                __format = __c;
+              else if (++__fmt != __fmtend)
+                {
+                  __mod = __c;
+                  __format = __ctype.narrow(*__fmt, 0);
+                }
+              else
+                {
+                  __err = ios_base::failbit;
+                  break;
+                }
+              __s = this->do_get(__s, __end, __io, __err, __tm, __format,
+				 __mod);
+              ++__fmt;
+            }
+          else if (__ctype.is(ctype_base::space, *__fmt))
+            {
+              ++__fmt;
+              while (__fmt != __fmtend &&
+                     __ctype.is(ctype_base::space, *__fmt))
+                ++__fmt;
+
+              while (__s != __end &&
+                     __ctype.is(ctype_base::space, *__s))
+                ++__s;
+            }
+          // TODO real case-insensitive comparison
+          else if (__ctype.tolower(*__s) == __ctype.tolower(*__fmt) ||
+                   __ctype.toupper(*__s) == __ctype.toupper(*__fmt))
+            {
+              ++__s;
+              ++__fmt;
+            }
+          else
+            {
+              __err = ios_base::failbit;
+              break;
+            }
+        }
+      return __s;
+    }
+
+  template<typename _CharT, typename _InIter>
+    inline
+    _InIter
+    time_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, tm* __tm,
+           char __format, char __mod) const
+    {
+      const locale& __loc = __io._M_getloc();
+      ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+      __err = ios_base::goodbit;
+
+      char_type __fmt[4];
+      __fmt[0] = __ctype.widen('%');
+      if (!__mod)
+        {
+          __fmt[1] = __format;
+          __fmt[2] = char_type();
+        }
+      else
+        {
+          __fmt[1] = __mod;
+          __fmt[2] = __format;
+          __fmt[3] = char_type();
+        }
+
+      __beg = _M_extract_via_format(__beg, __end, __io, __err, __tm, __fmt);
+      if (__beg == __end)
+	__err |= ios_base::eofbit;
+      return __beg;
+    }
+
+#endif // __cplusplus >= 201103L
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    time_put<_CharT, _OutIter>::
+    put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+	const _CharT* __beg, const _CharT* __end) const
+    {
+      const locale& __loc = __io._M_getloc();
+      ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+      for (; __beg != __end; ++__beg)
+	if (__ctype.narrow(*__beg, 0) != '%')
+	  {
+	    *__s = *__beg;
+	    ++__s;
+	  }
+	else if (++__beg != __end)
+	  {
+	    char __format;
+	    char __mod = 0;
+	    const char __c = __ctype.narrow(*__beg, 0);
+	    if (__c != 'E' && __c != 'O')
+	      __format = __c;
+	    else if (++__beg != __end)
+	      {
+		__mod = __c;
+		__format = __ctype.narrow(*__beg, 0);
+	      }
+	    else
+	      break;
+	    __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
+	  }
+	else
+	  break;
+      return __s;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    time_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm,
+	   char __format, char __mod) const
+    {
+      const locale& __loc = __io._M_getloc();
+      ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+      __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
+
+      // NB: This size is arbitrary. Should this be a data member,
+      // initialized at construction?
+      const size_t __maxlen = 128;
+      char_type __res[__maxlen];
+
+      // NB: In IEE 1003.1-200x, and perhaps other locale models, it
+      // is possible that the format character will be longer than one
+      // character. Possibilities include 'E' or 'O' followed by a
+      // format character: if __mod is not the default argument, assume
+      // it's a valid modifier.
+      char_type __fmt[4];
+      __fmt[0] = __ctype.widen('%');
+      if (!__mod)
+	{
+	  __fmt[1] = __format;
+	  __fmt[2] = char_type();
+	}
+      else
+	{
+	  __fmt[1] = __mod;
+	  __fmt[2] = __format;
+	  __fmt[3] = char_type();
+	}
+
+      __tp._M_put(__res, __maxlen, __fmt, __tm);
+
+      // Write resulting, fully-formatted string to output iterator.
+      return std::__write(__s, __res, char_traits<char_type>::length(__res));
+    }
+
+
+  // Inhibit implicit instantiations for required instantiations,
+  // which are defined via explicit instantiations elsewhere.
+#if _GLIBCXX_EXTERN_TEMPLATE
+  extern template class moneypunct<char, false>;
+  extern template class moneypunct<char, true>;
+  extern template class moneypunct_byname<char, false>;
+  extern template class moneypunct_byname<char, true>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_get<char>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_put<char>;
+  extern template class __timepunct<char>;
+  extern template class time_put<char>;
+  extern template class time_put_byname<char>;
+  extern template class time_get<char>;
+  extern template class time_get_byname<char>;
+  extern template class messages<char>;
+  extern template class messages_byname<char>;
+
+  extern template
+    const moneypunct<char, true>&
+    use_facet<moneypunct<char, true> >(const locale&);
+
+  extern template
+    const moneypunct<char, false>&
+    use_facet<moneypunct<char, false> >(const locale&);
+
+  extern template
+    const money_put<char>&
+    use_facet<money_put<char> >(const locale&);
+
+  extern template
+    const money_get<char>&
+    use_facet<money_get<char> >(const locale&);
+
+  extern template
+    const __timepunct<char>&
+    use_facet<__timepunct<char> >(const locale&);
+
+  extern template
+    const time_put<char>&
+    use_facet<time_put<char> >(const locale&);
+
+  extern template
+    const time_get<char>&
+    use_facet<time_get<char> >(const locale&);
+
+  extern template
+    const messages<char>&
+    use_facet<messages<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<moneypunct<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<money_put<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<money_get<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<__timepunct<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<time_put<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<time_get<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<messages<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  extern template class moneypunct<wchar_t, false>;
+  extern template class moneypunct<wchar_t, true>;
+  extern template class moneypunct_byname<wchar_t, false>;
+  extern template class moneypunct_byname<wchar_t, true>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_get<wchar_t>;
+  extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_put<wchar_t>;
+  extern template class __timepunct<wchar_t>;
+  extern template class time_put<wchar_t>;
+  extern template class time_put_byname<wchar_t>;
+  extern template class time_get<wchar_t>;
+  extern template class time_get_byname<wchar_t>;
+  extern template class messages<wchar_t>;
+  extern template class messages_byname<wchar_t>;
+
+  extern template
+    const moneypunct<wchar_t, true>&
+    use_facet<moneypunct<wchar_t, true> >(const locale&);
+
+  extern template
+    const moneypunct<wchar_t, false>&
+    use_facet<moneypunct<wchar_t, false> >(const locale&);
+
+  extern template
+    const money_put<wchar_t>&
+    use_facet<money_put<wchar_t> >(const locale&);
+
+  extern template
+    const money_get<wchar_t>&
+    use_facet<money_get<wchar_t> >(const locale&);
+
+  extern template
+    const __timepunct<wchar_t>&
+    use_facet<__timepunct<wchar_t> >(const locale&);
+
+  extern template
+    const time_put<wchar_t>&
+    use_facet<time_put<wchar_t> >(const locale&);
+
+  extern template
+    const time_get<wchar_t>&
+    use_facet<time_get<wchar_t> >(const locale&);
+
+  extern template
+    const messages<wchar_t>&
+    use_facet<messages<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<moneypunct<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<money_put<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<money_get<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<__timepunct<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<time_put<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<time_get<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<messages<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 206 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/localefwd.h

@@ -0,0 +1,206 @@
+// <locale> Forward declarations -*- C++ -*-
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/localefwd.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#ifndef _LOCALE_FWD_H
+#define _LOCALE_FWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/c++locale.h>  // Defines __c_locale, config-specific include
+#include <iosfwd>            // For ostreambuf_iterator, istreambuf_iterator
+#include <cctype>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /** 
+   *  @defgroup locales Locales
+   *
+   *  Classes and functions for internationalization and localization.
+   */
+
+  // 22.1.1 Locale
+  class locale;
+
+  template<typename _Facet>
+    bool
+    has_facet(const locale&) throw();
+
+  template<typename _Facet>
+    const _Facet&
+    use_facet(const locale&);
+
+  // 22.1.3 Convenience interfaces
+  template<typename _CharT>
+    bool
+    isspace(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isprint(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    iscntrl(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isupper(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    islower(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isalpha(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isdigit(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    ispunct(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isxdigit(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isalnum(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isgraph(_CharT, const locale&);
+
+#if __cplusplus >= 201103L
+  template<typename _CharT>
+    bool
+    isblank(_CharT, const locale&);
+#endif
+
+  template<typename _CharT>
+    _CharT
+    toupper(_CharT, const locale&);
+
+  template<typename _CharT>
+    _CharT
+    tolower(_CharT, const locale&);
+
+  // 22.2.1 and 22.2.1.3 ctype
+  class ctype_base;
+  template<typename _CharT>
+    class ctype;
+  template<> class ctype<char>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<> class ctype<wchar_t>;
+#endif
+  template<typename _CharT>
+    class ctype_byname;
+  // NB: Specialized for char and wchar_t in locale_facets.h.
+
+  class codecvt_base;
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt;
+  template<> class codecvt<char, char, mbstate_t>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template<> class codecvt<wchar_t, char, mbstate_t>;
+#endif
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt_byname;
+
+  // 22.2.2 and 22.2.3 numeric
+_GLIBCXX_BEGIN_NAMESPACE_LDBL
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class num_get;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class num_put;
+_GLIBCXX_END_NAMESPACE_LDBL
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+  template<typename _CharT> class numpunct;
+  template<typename _CharT> class numpunct_byname;
+_GLIBCXX_END_NAMESPACE_CXX11
+
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+  // 22.2.4 collation
+  template<typename _CharT>
+    class collate;
+  template<typename _CharT>
+    class collate_byname;
+_GLIBCXX_END_NAMESPACE_CXX11
+
+  // 22.2.5 date and time
+  class time_base;
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+  template<typename _CharT, typename _InIter =  istreambuf_iterator<_CharT> >
+    class time_get;
+  template<typename _CharT, typename _InIter =  istreambuf_iterator<_CharT> >
+    class time_get_byname;
+_GLIBCXX_END_NAMESPACE_CXX11
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class time_put;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class time_put_byname;
+
+  // 22.2.6 money
+  class money_base;
+_GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
+  template<typename _CharT, typename _InIter =  istreambuf_iterator<_CharT> >
+    class money_get;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class money_put;
+_GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+  template<typename _CharT, bool _Intl = false>
+    class moneypunct;
+  template<typename _CharT, bool _Intl = false>
+    class moneypunct_byname;
+_GLIBCXX_END_NAMESPACE_CXX11
+
+  // 22.2.7 message retrieval
+  class messages_base;
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
+  template<typename _CharT>
+    class messages;
+  template<typename _CharT>
+    class messages_byname;
+_GLIBCXX_END_NAMESPACE_CXX11
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 208 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/mask_array.h

@@ -0,0 +1,208 @@
+// The template and inlines for the -*- C++ -*- mask_array class.
+
+// Copyright (C) 1997-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/mask_array.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{valarray}
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _MASK_ARRAY_H
+#define _MASK_ARRAY_H 1
+
+#pragma GCC system_header
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @addtogroup numeric_arrays
+   * @{
+   */
+
+  /**
+   *  @brief  Reference to selected subset of an array.
+   *
+   *  A mask_array is a reference to the actual elements of an array specified
+   *  by a bitmask in the form of an array of bool.  The way to get a
+   *  mask_array is to call operator[](valarray<bool>) on a valarray.  The
+   *  returned mask_array then permits carrying operations out on the
+   *  referenced subset of elements in the original valarray.
+   *
+   *  For example, if a mask_array is obtained using the array (false, true,
+   *  false, true) as an argument, the mask array has two elements referring
+   *  to array[1] and array[3] in the underlying array.
+   *
+   *  @param  Tp  Element type.
+   */
+  template <class _Tp>
+    class mask_array
+    {
+    public:
+      typedef _Tp value_type;
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
+      ///  Copy constructor.  Both slices refer to the same underlying array.
+      mask_array (const mask_array&);
+      
+      ///  Assignment operator.  Assigns elements to corresponding elements
+      ///  of @a a.
+      mask_array& operator=(const mask_array&);
+
+      void operator=(const valarray<_Tp>&) const;
+      ///  Multiply slice elements by corresponding elements of @a v.
+      void operator*=(const valarray<_Tp>&) const;
+      ///  Divide slice elements by corresponding elements of @a v.
+      void operator/=(const valarray<_Tp>&) const;
+      ///  Modulo slice elements by corresponding elements of @a v.
+      void operator%=(const valarray<_Tp>&) const;
+      ///  Add corresponding elements of @a v to slice elements.
+      void operator+=(const valarray<_Tp>&) const;
+      ///  Subtract corresponding elements of @a v from slice elements.
+      void operator-=(const valarray<_Tp>&) const;
+      ///  Logical xor slice elements with corresponding elements of @a v.
+      void operator^=(const valarray<_Tp>&) const;
+      ///  Logical and slice elements with corresponding elements of @a v.
+      void operator&=(const valarray<_Tp>&) const;
+      ///  Logical or slice elements with corresponding elements of @a v.
+      void operator|=(const valarray<_Tp>&) const;
+      ///  Left shift slice elements by corresponding elements of @a v.
+      void operator<<=(const valarray<_Tp>&) const;
+      ///  Right shift slice elements by corresponding elements of @a v.
+      void operator>>=(const valarray<_Tp>&) const;
+      ///  Assign all slice elements to @a t.
+      void operator=(const _Tp&) const;
+
+        //        ~mask_array ();
+
+      template<class _Dom>
+        void operator=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator*=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator/=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator%=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator+=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator-=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator^=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator&=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator|=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator<<=(const _Expr<_Dom,_Tp>&) const;
+      template<class _Dom>
+        void operator>>=(const _Expr<_Dom,_Tp>&) const;
+
+    private:
+      mask_array(_Array<_Tp>, size_t, _Array<bool>);
+      friend class valarray<_Tp>;
+
+      const size_t       _M_sz;
+      const _Array<bool> _M_mask;
+      const _Array<_Tp>  _M_array;
+
+      // not implemented
+      mask_array();
+    };
+
+  template<typename _Tp>
+    inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& __a)
+    : _M_sz(__a._M_sz), _M_mask(__a._M_mask), _M_array(__a._M_array) {}
+
+  template<typename _Tp>
+    inline
+    mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m)
+    : _M_sz(__s), _M_mask(__m), _M_array(__a) {}
+
+  template<typename _Tp>
+    inline mask_array<_Tp>&
+    mask_array<_Tp>::operator=(const mask_array<_Tp>& __a)
+    {
+      std::__valarray_copy(__a._M_array, __a._M_mask,
+			   _M_sz, _M_array, _M_mask);
+      return *this;
+    }
+
+  template<typename _Tp>
+    inline void
+    mask_array<_Tp>::operator=(const _Tp& __t) const
+    { std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); }
+
+  template<typename _Tp>
+    inline void
+    mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+    { std::__valarray_copy(_Array<_Tp>(__v), __v.size(), _M_array, _M_mask); }
+
+  template<typename _Tp>
+    template<class _Ex>
+      inline void
+      mask_array<_Tp>::operator=(const _Expr<_Ex, _Tp>& __e) const
+      { std::__valarray_copy(__e, __e.size(), _M_array, _M_mask); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)				\
+  template<typename _Tp>						\
+    inline void								\
+    mask_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const	\
+    {									\
+      _Array_augmented_##_Name(_M_array, _M_mask,			\
+			       _Array<_Tp>(__v), __v.size());		\
+    }									\
+									\
+  template<typename _Tp>                                                \
+    template<class _Dom>			                        \
+      inline void							\
+      mask_array<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) const\
+      {									\
+	_Array_augmented_##_Name(_M_array, _M_mask, __e, __e.size());   \
+      }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+  // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _MASK_ARRAY_H */

+ 78 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/memoryfwd.h

@@ -0,0 +1,78 @@
+// <memory> Forward declarations -*- C++ -*-
+
+// Copyright (C) 2001-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file bits/memoryfwd.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{memory}
+ */
+
+#ifndef _MEMORYFWD_H
+#define _MEMORYFWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   * @defgroup allocators Allocators
+   * @ingroup memory
+   *
+   * Classes encapsulating memory operations.
+   *
+   * @{
+   */
+
+  template<typename>
+    class allocator;
+
+  template<>
+    class allocator<void>;
+
+  /// Declare uses_allocator so it can be specialized in \<queue\> etc.
+  template<typename, typename>
+    struct uses_allocator;
+
+  /// @} group memory
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif

+ 225 - 0
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.5.0/bits/move.h

@@ -0,0 +1,225 @@
+// Move, forward and identity for C++11 + swap -*- C++ -*-
+
+// Copyright (C) 2007-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/move.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{utility}
+ */
+
+#ifndef _MOVE_H
+#define _MOVE_H 1
+
+#include <bits/c++config.h>
+#include <bits/concept_check.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Used, in C++03 mode too, by allocators, etc.
+  /**
+   *  @brief Same as C++11 std::addressof
+   *  @ingroup utilities
+   */
+  template<typename _Tp>
+    inline _GLIBCXX_CONSTEXPR _Tp*
+    __addressof(_Tp& __r) _GLIBCXX_NOEXCEPT
+    { return __builtin_addressof(__r); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#if __cplusplus >= 201103L
+#include <type_traits> // Brings in std::declval too.
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @addtogroup utilities
+   *  @{
+   */
+
+  /**
+   *  @brief  Forward an lvalue.
+   *  @return The parameter cast to the specified type.
+   *
+   *  This function is used to implement "perfect forwarding".
+   */
+  template<typename _Tp>
+    constexpr _Tp&&
+    forward(typename std::remove_reference<_Tp>::type& __t) noexcept
+    { return static_cast<_Tp&&>(__t); }
+
+  /**
+   *  @brief  Forward an rvalue.
+   *  @return The parameter cast to the specified type.
+   *
+   *  This function is used to implement "perfect forwarding".
+   */
+  template<typename _Tp>
+    constexpr _Tp&&
+    forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
+    {
+      static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument"
+		    " substituting _Tp is an lvalue reference type");
+      return static_cast<_Tp&&>(__t);
+    }
+
+  /**
+   *  @brief  Convert a value to an rvalue.
+   *  @param  __t  A thing of arbitrary type.
+   *  @return The parameter cast to an rvalue-reference to allow moving it.
+  */
+  template<typename _Tp>
+    constexpr typename std::remove_reference<_Tp>::type&&
+    move(_Tp&& __t) noexcept
+    { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
+
+
+  template<typename _Tp>
+    struct __move_if_noexcept_cond
+    : public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
+                    is_copy_constructible<_Tp>>::type { };
+
+  /**
+   *  @brief  Conditionally convert a value to an rvalue.
+   *  @param  __x  A thing of arbitrary type.
+   *  @return The parameter, possibly cast to an rvalue-reference.
+   *
+   *  Same as std::move unless the type's move constructor could throw and the
+   *  type is copyable, in which case an lvalue-reference is returned instead.
+   */
+  template<typename _Tp>
+    constexpr typename
+    conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
+    move_if_noexcept(_Tp& __x) noexcept
+    { return std::move(__x); }
+
+  // declval, from type_traits.
+
+#if __cplusplus > 201402L
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 2296. std::addressof should be constexpr
+# define __cpp_lib_addressof_constexpr 201603
+#endif
+  /**
+   *  @brief Returns the actual address of the object or function
+   *         referenced by r, even in the presence of an overloaded
+   *         operator&.
+   *  @param  __r  Reference to an object or function.
+   *  @return   The actual address.
+  */
+  template<typename _Tp>
+    inline _GLIBCXX17_CONSTEXPR _Tp*
+    addressof(_Tp& __r) noexcept
+    { return std::__addressof(__r); }
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 2598. addressof works on temporaries
+  template<typename _Tp>
+    const _Tp* addressof(const _Tp&&) = delete;
+
+  // C++11 version of std::exchange for internal use.
+  template <typename _Tp, typename _Up = _Tp>
+    inline _Tp
+    __exchange(_Tp& __obj, _Up&& __new_val)
+    {
+      _Tp __old_val = std::move(__obj);
+      __obj = std::forward<_Up>(__new_val);
+      return __old_val;
+    }
+
+  /// @} group utilities
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#define _GLIBCXX_MOVE(__val) std::move(__val)
+#define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
+#else
+#define _GLIBCXX_MOVE(__val) (__val)
+#define _GLIBCXX_FORWARD(_Tp, __val) (__val)
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /**
+   *  @addtogroup utilities
+   *  @{
+   */
+
+  /**
+   *  @brief Swaps two values.
+   *  @param  __a  A thing of arbitrary type.
+   *  @param  __b  Another thing of arbitrary type.
+   *  @return   Nothing.
+  */
+  template<typename _Tp>
+    inline
+#if __cplusplus >= 201103L
+    typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
+			      is_move_constructible<_Tp>,
+			      is_move_assignable<_Tp>>::value>::type
+    swap(_Tp& __a, _Tp& __b)
+    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
+	            is_nothrow_move_assignable<_Tp>>::value)
+#else
+    void
+    swap(_Tp& __a, _Tp& __b)
+#endif
+    {
+      // concept requirements
+      __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
+
+      _Tp __tmp = _GLIBCXX_MOVE(__a);
+      __a = _GLIBCXX_MOVE(__b);
+      __b = _GLIBCXX_MOVE(__tmp);
+    }
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // DR 809. std::swap should be overloaded for array types.
+  /// Swap the contents of two arrays.
+  template<typename _Tp, size_t _Nm>
+    inline
+#if __cplusplus >= 201103L
+    typename enable_if<__is_swappable<_Tp>::value>::type
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+    noexcept(__is_nothrow_swappable<_Tp>::value)
+#else
+    void
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+#endif
+    {
+      for (size_t __n = 0; __n < _Nm; ++__n)
+	swap(__a[__n], __b[__n]);
+    }
+
+  /// @} group utilities
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif /* _MOVE_H */

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä