CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: string class

  1. #1
    Join Date
    Apr 2011
    Posts
    18

    string class

    Is string class a container too ?
    As I see, it also has begin and end iterator/

    Thankyou

  2. #2
    Join Date
    Aug 2008
    Posts
    902

    Re: string class

    std::string is really just a typedef for std::basic_string<char>

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: string class

    I believe std::string meets most of the requirements for a container. I'm not sure it meets all of them.

  4. #4
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721

    Re: string class

    From the 2003 standard:

    21.3 paragraph 2

    The class template basic_string conforms to the requirements of a Sequence, as specified in (23.1.1).
    Additionally, because the iterators supported by basic_string are random access iterators (24.1.5),
    basic_string conforms to the the requirements of a Reversible Container, as specified in (23.1).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured