open-watcom / open-watcom-v2

Open Watcom V2.0 - Source code repository, Wiki, Latest Binary build, Archived builds including all installers for download.
Other
965 stars 157 forks source link

OWCSTL string missing C++98 features #892

Open adamyg opened 2 years ago

adamyg commented 2 years ago

Hi, the following C++98 elements are missing from the current <string> / <_strdef.h> implementation:

Iterator interfaces:

  template <class InputIterator>
  string  (InputIterator first, InputIterator last);
  template <class InputIterator>
  string& assign (InputIterator first, InputIterator last);

Compare Methods:

  int compare (const string& str) const;
  int compare (size_t pos, size_t len, const string& str) const; 
  int compare (size_t pos, size_t len, const string& str, size_t subpos, size_t sublen) const;
  int compare (const char* s) const;
  int compare (size_t pos, size_t len, const char* s) const;
  int compare (size_t pos, size_t len, const char* s, size_t n) const;

For greater portability the following C++11 features could also be added:

  const_iterator cbegin() const /*noexcept*/;
  const_iterator cend() const /*noexcept*/ ;
  const_reverse_iterator crbegin() const /*noexcept*/ ;
  const_reverse_iterator crend() const /*noexcept*/;
  char& front();
  const char& front() const;
  void pop_back();
  void shrink_to_fit()
revelator commented 2 years ago

not sure how far it has progressed since i last checked, but open watcoms c++ compiler was pretty barebones and did not have full support for C++98. To get better support the C++ compiler needs an update unfortunatly the project only has one devoted C++ maintainer. Im sure any help is appeciated non the less :).

pchapin commented 2 years ago

Thanks for your report. As @revelator mentioned, support for even C++98 is incomplete throughout the library. There is (very slow) work toward remedying that situation, and it is ongoing. I will mark this issue as a library enhancement.