From 43961718fa9777cc76721bdb9edcf494ca269cd7 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Jun 2020 12:11:42 +0200 Subject: [PATCH] parser-inc: add missing template args to std containers --- dtool/src/parser-inc/map | 24 ++++++++++++++---------- dtool/src/parser-inc/ostream | 2 ++ dtool/src/parser-inc/string | 17 +++++++++-------- dtool/src/parser-inc/vector | 16 ++++++++++------ 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/dtool/src/parser-inc/map b/dtool/src/parser-inc/map index 19611a8696..cabeb219bc 100644 --- a/dtool/src/parser-inc/map +++ b/dtool/src/parser-inc/map @@ -24,19 +24,23 @@ #include #include -template > +namespace std { + template class allocator; +} + +template, class Allocator = std::allocator > > class map { public: - typedef key key_type; - typedef element data_type; - typedef element mapped_type; - typedef pair value_type; - typedef compare key_compare; + typedef Key key_type; + typedef Element data_type; + typedef Element mapped_type; + typedef pair value_type; + typedef Compare key_compare; - typedef element *pointer; - typedef const element *const_pointer; - typedef element &reference; - typedef const element &const_reference; + typedef Element *pointer; + typedef const Element *const_pointer; + typedef Element &reference; + typedef const Element &const_reference; class iterator; class const_iterator; diff --git a/dtool/src/parser-inc/ostream b/dtool/src/parser-inc/ostream index fb7f7ea51e..58de77c0cc 100644 --- a/dtool/src/parser-inc/ostream +++ b/dtool/src/parser-inc/ostream @@ -1,5 +1,7 @@ #pragma once +#include + namespace std { template std::basic_ostream &ends(std::basic_ostream &os); diff --git a/dtool/src/parser-inc/string b/dtool/src/parser-inc/string index 841e6fd7c6..85e18a82ce 100644 --- a/dtool/src/parser-inc/string +++ b/dtool/src/parser-inc/string @@ -26,6 +26,7 @@ namespace std { template struct char_traits; + template class allocator; template<> struct char_traits { using char_type = char; @@ -51,7 +52,7 @@ namespace std { using state_type = mbstate_t; }; - template + template, class Allocator = std::allocator > class basic_string { public: struct iterator; @@ -63,17 +64,17 @@ namespace std { static const size_t npos = -1; basic_string(); - basic_string(const basic_string ©); - void operator = (const basic_string ©); - basic_string(const ctype *string); + basic_string(const basic_string ©); + void operator = (const basic_string ©); + basic_string(const CharT *string); ~basic_string(); - const ctype *c_str() const; + const CharT *c_str() const; size_t length() const; - ctype at(size_t pos) const; - ctype operator[](size_t pos) const; - ctype &operator[](size_t pos); + CharT at(size_t pos) const; + CharT operator[](size_t pos) const; + CharT &operator[](size_t pos); }; typedef basic_string string; diff --git a/dtool/src/parser-inc/vector b/dtool/src/parser-inc/vector index e83a5ff911..b643498999 100644 --- a/dtool/src/parser-inc/vector +++ b/dtool/src/parser-inc/vector @@ -22,17 +22,21 @@ #include +namespace std { + template class allocator; +} + inline namespace std { -template +template > class vector { public: - typedef element value_type; + typedef T value_type; - typedef element *pointer; - typedef const element *const_pointer; - typedef element &reference; - typedef const element &const_reference; + typedef T *pointer; + typedef const T *const_pointer; + typedef T &reference; + typedef const T &const_reference; typedef pointer iterator; typedef const_pointer const_iterator;