471,072 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,072 software developers and data experts.

Are the Standard Header available in source form?

Are the Standard Headers as described in ISO/IEC 14882:2003 available in
source file form as they appear in the standard? What I mean by this is,
for example 20.4 describes the Header<memory> and contains segments of C++
code such as the following:

namespace std {
// 20.4.1, the default allocator:
template <class T> class allocator;
template <> class allocator<void>;
template <class T, class U>
bool operator==(const allocator<T>&, const allocator<U>&) throw();
template <class T, class U>
bool operator!=(const allocator<T>&, const allocator<U>&) throw();
// 20.4.2, raw storage iterator:
template <class OutputIterator, class T> class raw_storage_iterator;
// 20.4.3, temporary buffers:
template <class T>
pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n);
template <class T>
void return_temporary_buffer(T* p);
// 20.4.4, specialized algorithms:
template <class InputIterator, class ForwardIterator>
ForwardIterator
uninitialized_copy(InputIterator first, InputIterator last,
ForwardIterator result);
template <class ForwardIterator, class T>
void uninitialized_fill(ForwardIterator first, ForwardIterator last,
const T& x);
template <class ForwardIterator, class Size, class T>
void uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
// 20.4.5, pointers:
template<class X> class auto_ptr;
}
I can go through the entire document copying the contents of the 50 Headers
into text files. I have done just that for some of the headers. It seems
like a lot of unnecessary work if I can obtain these by downloading them.
The primary reason I want this is so I can build a tag database
representing the Standard Library.
--
"[M]y dislike for the preprocessor is well known. Cpp is essential in C
programming, and still important in conventional C++ implementations, but
it is a hack, and so are most of the techniques that rely on it. ...I think
the time has come to be serious about macro-free C++ programming." - B. S.

Jul 22 '05 #1
4 1228

"Steven T. Hatton" <su******@setidava.kushan.aa> skrev i en meddelelse
news:2O********************@speakeasy.net...
Are the Standard Headers as described in ISO/IEC 14882:2003 available in
source file form as they appear in the standard? What I mean by this is,
for example 20.4 describes the Header<memory> and contains segments of C++ code such as the following:

namespace std {
// 20.4.1, the default allocator:
template <class T> class allocator;
template <> class allocator<void>;
template <class T, class U>
bool operator==(const allocator<T>&, const allocator<U>&) throw();
template <class T, class U>
bool operator!=(const allocator<T>&, const allocator<U>&) throw();
// 20.4.2, raw storage iterator:
template <class OutputIterator, class T> class raw_storage_iterator;
// 20.4.3, temporary buffers:
template <class T>
pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n);
template <class T>
void return_temporary_buffer(T* p);
// 20.4.4, specialized algorithms:
template <class InputIterator, class ForwardIterator>
ForwardIterator
uninitialized_copy(InputIterator first, InputIterator last,
ForwardIterator result);
template <class ForwardIterator, class T>
void uninitialized_fill(ForwardIterator first, ForwardIterator last,
const T& x);
template <class ForwardIterator, class Size, class T>
void uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
// 20.4.5, pointers:
template<class X> class auto_ptr;
}
I can go through the entire document copying the contents of the 50 Headers into text files. I have done just that for some of the headers. It seems
like a lot of unnecessary work if I can obtain these by downloading them.
The primary reason I want this is so I can build a tag database
representing the Standard Library.
--
"[M]y dislike for the preprocessor is well known. Cpp is essential in C
programming, and still important in conventional C++ implementations, but
it is a hack, and so are most of the techniques that rely on it. ...I think the time has come to be serious about macro-free C++ programming." - B. S.


This isn't guaranteed by the standard, but my bet is you'll find these
headers with your compiler distribution.

/Peter
Jul 22 '05 #2
Peter Koch Larsen wrote:

This isn't guaranteed by the standard, but my bet is you'll find these
headers with your compiler distribution.

/Peter


Much to my surprise that isn't quite as simple as it may seem. There are
header file representing the Standard Headers, but they are not very
similar to the files produced by simply copying the header declarations
from the Standard. This seems to be the case with both my GCC and
Microsoft compilers.
--
"[M]y dislike for the preprocessor is well known. Cpp is essential in C
programming, and still important in conventional C++ implementations, but
it is a hack, and so are most of the techniques that rely on it. ...I think
the time has come to be serious about macro-free C++ programming." - B. S.

Jul 22 '05 #3
In message <yv********************@speakeasy.net>, Steven T. Hatton
<su******@setidava.kushan.aa> writes
Peter Koch Larsen wrote:
This isn't guaranteed by the standard, but my bet is you'll find these
headers with your compiler distribution.

/Peter


Much to my surprise that isn't quite as simple as it may seem. There are
header file representing the Standard Headers, but they are not very
similar to the files produced by simply copying the header declarations
from the Standard. This seems to be the case with both my GCC and
Microsoft compilers.


Why is that surprising, given the number of times the words
*implementation defined* occur in the declarations in the Standard?

--
Richard Herring
Jul 22 '05 #4
Richard Herring wrote:
In message <yv********************@speakeasy.net>, Steven T. Hatton
<su******@setidava.kushan.aa> writes
Peter Koch Larsen wrote:
This isn't guaranteed by the standard, but my bet is you'll find these
headers with your compiler distribution.

/Peter


Much to my surprise that isn't quite as simple as it may seem. There are
header file representing the Standard Headers, but they are not very
similar to the files produced by simply copying the header declarations
from the Standard. This seems to be the case with both my GCC and
Microsoft compilers.


Why is that surprising, given the number of times the words
*implementation defined* occur in the declarations in the Standard?


Out of 50 headers that appears 36 times. Always in reference to iterators
except for the case in vector where it is in reference to pointer and
const_pointer. I only appears in typedef statements which could very
easily be modified by the implementer by replacing the words
"implementation defined" with the identifier for the implementations
definition.

--
"[M]y dislike for the preprocessor is well known. Cpp is essential in C
programming, and still important in conventional C++ implementations, but
it is a hack, and so are most of the techniques that rely on it. ...I think
the time has come to be serious about macro-free C++ programming." - B. S.

Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Web Developer | last post: by
31 posts views Thread by Steven T. Hatton | last post: by
43 posts views Thread by Steven T. Hatton | last post: by
1 post views Thread by Thomas Holmgren | last post: by
2 posts views Thread by Chad | last post: by
7 posts views Thread by Robert Seacord | last post: by
7 posts views Thread by ben | last post: by
16 posts views Thread by wdh3rd | last post: by
reply views Thread by leo001 | last post: by

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.