Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

Question on STL string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bonj - 17 Oct 2004 21:30 GMT
A basic string, declared using my own custom-defined typedef:
typedef TSTRING std::basic_string<_TCHAR>;
would TSTRING::data() have O(x) exeuction time proportionality to the size
of the string, or static?
Carl Daniel [VC++ MVP] - 17 Oct 2004 21:45 GMT
> A basic string, declared using my own custom-defined typedef:
> typedef TSTRING std::basic_string<_TCHAR>;
> would TSTRING::data() have O(x) exeuction time proportionality to the
> size of the string, or static?

It's not specified in the standard whether data() has O(n) or O(1)
complexity, but AFIAK all known implementations have O(1) complexity.

-cd
Bonj - 18 Oct 2004 00:23 GMT
that's good

>> A basic string, declared using my own custom-defined typedef:
>> typedef TSTRING std::basic_string<_TCHAR>;
[quoted text clipped - 5 lines]
>
> -cd
P.J. Plauger - 18 Oct 2004 02:12 GMT
>A basic string, declared using my own custom-defined typedef:
> typedef TSTRING std::basic_string<_TCHAR>;
> would TSTRING::data() have O(x) exeuction time proportionality to the size
> of the string, or static?

Static.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.