I want to modify STL to suite my requirement

Z

zhongling

I want to modify STL to suite my requirement, So I download sgi STL ,
Now I am reading one file of them "concept_checks.h", I don't how it
can check the concept and report error when compile,
such as follow semantics,I need some anotate.

#define __STL_REQUIRES(__type_var, __concept) \
do { \
void (*__x)( __type_var ) = __concept##_concept_specification<
__type_var >\
::__concept##_requirement_violation; __x = __x; } while (0)


#define __STL_GENERATOR_CHECK(__func, __ret) \
do { \
__ret (*__x)( __func&) = \
_STL_GENERATOR_ERROR< \
__func, __ret>::__generator_requirement_violation; \
__x = __x; } while (0)


#define __STL_CLASS_REQUIRES(__type_var, __concept) \
typedef void (* __func##__type_var##__concept)( __type_var ); \
template <__func##__type_var##__concept _Tp1> \
struct __dummy_struct_##__type_var##__concept { }; \
static __dummy_struct_##__type_var##__concept< \
__concept##_concept_specification< \
__type_var>::__concept##_requirement_violation> \
__dummy_ptr_##__type_var##__concept


I need some help to anotate these sentence, complete file is follow ,it

can be referenced.
 
B

benben

I want to modify STL to suite my requirement, So I download sgi STL ,
Now I am reading one file of them "concept_checks.h", I don't how it
can check the concept and report error when compile,
such as follow semantics,I need some anotate.

Not a good idea modifying the standard library. And why do you want to?
What are your requirements? What do you want to achieve?

There are a number of ways to configure the STL to suit your needs. For
example, providing an alternate allocator. Otherwise reuse the library
just like reusing any other libraries.

I just can't think of a good reason to modify the library itself.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top