Menu

#49 support concept definitions

Future
accepted
None
Functionality
major
0.4.0
enhancement
2012-05-31
2012-05-10
No

It should be possible to extend the parsing macros to support N2081-like concept definition and then use something like Boost.Generic (or maybe Steven Watanable type erasure library) to actually implement the contract definitions (see section in 0.4.0 docs).

Supporting N2081-like concept definition will probably only work on C++11.
It can still be backward compatible because I could dispatch concept checking using template meta-programming:

if is_contract_concept<C> then contract_concept_check<C>
else boost_concept_check<C>

is_contract_concept could be implemented by tagging every concept that is defined using this library (e.g., with a special base class and then use is_base<C, contract_aux_concept_base> to inspect).
If a concept is not derived from contract_aux_concept, it's assumed to be from Boost.ConceptChecking therefore maintaining backward compatibility.

Discussion

  • Lorenzo Caminiti

    • summary changed from support concept definition to support concept definitions
     
  • Lorenzo Caminiti

    • component changed from Implementation to Interface
     
  • Lorenzo Caminiti

    • priority changed from critical to major
    • status changed from new to accepted

    This would be a very nice addition to the library and it will probably boot ;) the library popularity within the C++ community (C++ programmers seems to like concepts much more than contracts, for example N2081 was almost accepted in C++11 but N1962 got much smaller attention).

     

Log in to post a comment.