Question on STL string

  • Thread starter Thread starter Bonj
  • Start date Start date
B

Bonj

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?
 
Bonj said:
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
 
that's good

Carl Daniel said:
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
 
Back
Top