BVB Source Codes

mars Show concept.hpp Source code

Return Download mars: download concept.hpp Source code - Download mars Source code - Type:.hpp
  1. //  Boost string_algo library concept.hpp header file  ---------------------------//
  2.  
  3. //  Copyright Pavol Droba 2002-2003.
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. //    (See accompanying file LICENSE_1_0.txt or copy at
  7. //          http://www.boost.org/LICENSE_1_0.txt)
  8.  
  9. //  See http://www.boost.org/ for updates, documentation, and revision history.
  10.  
  11. #ifndef BOOST_STRING_CONCEPT_HPP
  12. #define BOOST_STRING_CONCEPT_HPP
  13.  
  14. #include <boost/concept_check.hpp>
  15. #include <boost/range/iterator_range_core.hpp>
  16. #include <boost/range/begin.hpp>
  17. #include <boost/range/end.hpp>
  18.  
  19. /*! \file
  20.     Defines concepts used in string_algo library
  21. */
  22.  
  23. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  24.     namespace algorithm {
  25.  
  26.         //! Finder concept
  27.         /*!
  28.             Defines the Finder concept. Finder is a functor which selects
  29.             an arbitrary part of a string. Search is performed on
  30.             the range specified by starting and ending iterators.
  31.  
  32.             Result of the find operation must be convertible to iterator_range.
  33.         */
  34.         template<typename FinderT, typename IteratorT>
  35.         struct FinderConcept
  36.         {
  37.         private:
  38.             typedef iterator_range<IteratorT> range;
  39.         public:
  40.             void constraints()
  41.             {
  42.                 // Operation
  43.                 r=(*pF)(i,i);
  44.             }
  45.         private:
  46.             range r;
  47.             IteratorT i;
  48.             FinderT* pF;    
  49.         }; // Finder_concept
  50.  
  51.        
  52.         //! Formatter concept
  53.         /*!
  54.             Defines the Formatter concept. Formatter is a functor, which
  55.             takes a result from a finder operation and transforms it
  56.             in a specific way.
  57.  
  58.             Result must be a container supported by container_traits,
  59.             or a reference to it.
  60.         */
  61.         template<typename FormatterT, typename FinderT, typename IteratorT>
  62.         struct FormatterConcept
  63.         {
  64.         public:
  65.             void constraints()
  66.             {
  67.                 // Operation
  68.                 ::mars_boost::begin((*pFo)( (*pF)(i,i) ));
  69.                 ::mars_boost::end((*pFo)( (*pF)(i,i) ));
  70.             }
  71.         private:
  72.             IteratorT i;
  73.             FinderT* pF;
  74.             FormatterT *pFo;
  75.         }; // FormatterConcept;
  76.  
  77.     } // namespace algorithm
  78. } // namespace mars_boost
  79.  
  80.  
  81.  
  82.  
  83. #endif  // BOOST_STRING_CONCEPT_HPP
  84.  
downloadconcept.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top