473,761 Members | 5,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

size_type requirements

Can someone tell me what is required of the size_type type for standard
containers (and other standard classes defining this type)? Specifically:

1) Are the requirements the same for each container & class?

2) Is it required to have a particular "signed-ness", and if so, which one?

3) Are there required minimum limits for size_type, and if so, what are
they?

4) Is size_type required to be an alias for one of the built-in types?

Thanks.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #1
1 4972
On Fri, 12 Sep 2003 22:49:27 +0000, Kevin Goodsell wrote:
Can someone tell me what is required of the size_type type for standard
containers (and other standard classes defining this type)? Specifically:

1) Are the requirements the same for each container & class?

2) Is it required to have a particular "signed-ness", and if so, which one?

3) Are there required minimum limits for size_type, and if so, what are
they?

4) Is size_type required to be an alias for one of the built-in types?


You can look it up for yourself:
http://oscinfo.osc.edu/software/docs...r.requirements

Josh
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5725
by: Alex J. Dam | last post by:
Hi, which guidelines should be used about those integer types defined in the C++ Standard Library, like string::size_type, istream::pos_type, etc.? Are they meant to be used only in the library code? For example, if I call istream::tellg(), should I store its result in a variable of type pos_type? Are there any problems if I simply use ints everywhere?
10
8640
by: Grumble | last post by:
What is the difference between size_t and vector<T>::size_type? Are they ever a different type or a different size? Why should one type the latter when the former is shorter? What about the size_type type in other STL classes? -- Regards, Grumble
3
2399
by: Eric Lilja | last post by:
Hello, I was working on a program where I needed to take a vector storing objects of type std::string and convert each object to an int and store the ints in another vector. I decided that I should create a templated function for this because I've done similar things before and expect to do similar things again (i.e., converting a collection of one type to a collection of another type). This is my test program, it compiles but if I try to...
4
1959
by: Frederick Ding | last post by:
Hi,guys! Please look at this problem, when I use "int i", it success, but when I use string::size_type i, it fail with a out_of_range exception. //---------------- begin---------------------------- int str_to_num(const string& s) { int num = 0; int interval = 1; int i; // success
3
2269
by: Jess | last post by:
Hello, I think any specialized size_type, such as string::size_type and vector<T>::size_type, is defined in terms of size_t, which is much more low level. Since they are more or less equivalent, what's the advantage of using size_type over size_t? Thanks, Jess
13
7623
by: t.hall | last post by:
Is std::vector<T>::size_type guaranteed to be the same type as std::vector<U>::size_type? To be more explicit, given void f(T, U); and std::vector<Tvt; std::vector<Uvu; which have the same size, can I write
3
2675
by: cablepuff | last post by:
Alright, I am sort of confused on c++ iterators having both distance_type and size_type. On sgi and Microsoft compiler it uses distance_type for input iterator. For mingw and cygwin it uses size_type , is it just standard issues or is it platform dependent.
15
1712
by: Lambda | last post by:
I'm writing a function to partition a vector according to a predicate. For example: vector<string>::size_type partition(vector<Student_info&v) { vector<string>::size_type i, j; i = -1; j = v.size(); while (true)
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.