Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1282

collection::name() should not guarantee returned string is null-terminated

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Minor Change
    • Story Points:
      1
    • Sprint:
      Perl/CXX 2017-03-24

      Description

      The current documentation for collection::name() is as follows:

      508     ///
      509     /// Returns the name of this collection as a view of a null-terminated string.
      510     ///
      511     /// @return The name of the collection.
      512     ///
      513     stdx::string_view name() const;
      

      It's generally not appropriate to pass around stdx::string_view objects with annotations of the fact that the underlying string is null-terminated, since this knowledge is hidden from the type system. Documenting to users that this string is null-terminated also limits the ability of authors to add performance optimizations to this function in the future. We should remove this note from our public-facing documentation, and update our implementation to improve clarity where this function is used.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: