By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,419 Members | 1,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,419 IT Pros & Developers. It's quick & easy.

Are the Standard Header available in source form?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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.