00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: rangelib/filtered_sequence.hpp 00003 * 00004 * Purpose: Sequence range filter adaptation. 00005 * 00006 * Created: 28th December 2005 00007 * Updated: 10th August 2009 00008 * 00009 * Home: http://stlsoft.org/ 00010 * 00011 * Copyright (c) 2005-2009, Matthew Wilson and Synesis Software 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are met: 00016 * 00017 * - Redistributions of source code must retain the above copyright notice, this 00018 * list of conditions and the following disclaimer. 00019 * - Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of 00023 * any contributors may be used to endorse or promote products derived from 00024 * this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00027 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00029 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00030 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00031 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00032 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00033 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00034 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00035 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00036 * POSSIBILITY OF SUCH DAMAGE. 00037 * 00038 * ////////////////////////////////////////////////////////////////////// */ 00039 00040 00043 #ifndef RANGELIB_INCL_RANGELIB_HPP_FILTERED_SEQUENCE 00044 #define RANGELIB_INCL_RANGELIB_HPP_FILTERED_SEQUENCE 00045 00046 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00047 # define RANGELIB_VER_RANGELIB_HPP_FILTERED_SEQUENCE_MAJOR 1 00048 # define RANGELIB_VER_RANGELIB_HPP_FILTERED_SEQUENCE_MINOR 0 00049 # define RANGELIB_VER_RANGELIB_HPP_FILTERED_SEQUENCE_REVISION 1 00050 # define RANGELIB_VER_RANGELIB_HPP_FILTERED_SEQUENCE_EDIT 6 00051 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00052 00053 /* ///////////////////////////////////////////////////////////////////////// 00054 * Auto-generation and compatibility 00055 */ 00056 00057 /* 00058 [Incompatibilies-start] 00059 STLSOFT_COMPILER_IS_BORLAND: 00060 STLSOFT_COMPILER_IS_DMC: __DMC__ < 0x0845 00061 STLSOFT_COMPILER_IS_MSVC: _MSC_VER < 1310 00062 STLSOFT_COMPILER_IS_MWERKS: (__MWERKS__ & 0xFF00) < 0x3000 00063 [Incompatibilies-end] 00064 */ 00065 00066 /* ///////////////////////////////////////////////////////////////////////// 00067 * Includes 00068 */ 00069 00070 #ifndef RANGELIB_INCL_RANGELIB_HPP_RANGELIB 00071 # include <rangelib/rangelib.hpp> 00072 #endif /* !RANGELIB_INCL_RANGELIB_HPP_RANGELIB */ 00073 #ifndef RANGELIB_INCL_RANGELIB_HPP_FILTERED_RANGE 00074 # include <rangelib/filtered_range.hpp> 00075 #endif /* !RANGELIB_INCL_RANGELIB_HPP_FILTERED_RANGE */ 00076 #ifndef RANGELIB_INCL_RANGELIB_HPP_SEQUENCE_RANGE 00077 # include <rangelib/sequence_range.hpp> 00078 #endif /* !RANGELIB_INCL_RANGELIB_HPP_SEQUENCE_RANGE */ 00079 00080 /* ///////////////////////////////////////////////////////////////////////// 00081 * Namespace 00082 */ 00083 00084 #ifndef RANGELIB_NO_NAMESPACE 00085 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00086 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) 00087 /* There is no stlsoft namespace, so must define ::rangelib */ 00088 namespace rangelib 00089 { 00090 # else 00091 /* Define stlsoft::rangelib_project */ 00092 00093 namespace stlsoft 00094 { 00095 00096 namespace rangelib_project 00097 { 00098 00099 # endif /* _STLSOFT_NO_NAMESPACE */ 00100 #endif /* !RANGELIB_NO_NAMESPACE */ 00101 00102 /* ///////////////////////////////////////////////////////////////////////// 00103 * Creator functions 00104 */ 00105 00106 template< ss_typename_param_k S 00107 , ss_typename_param_k P 00108 > 00109 inline filtered_range<sequence_range<S>, P> filter_sequence(S &s, P pr) 00110 { 00111 return filter_range(make_sequence_range(s), pr); 00112 } 00113 00115 // Unit-testing 00116 00117 #ifdef STLSOFT_UNITTEST 00118 # include "./unittest/filtered_sequence_unittest_.h" 00119 #endif /* STLSOFT_UNITTEST */ 00120 00121 /* ////////////////////////////////////////////////////////////////////// */ 00122 00123 #ifndef RANGELIB_NO_NAMESPACE 00124 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00125 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) 00126 } // namespace rangelib 00127 # else 00128 } // namespace rangelib_project 00129 } // namespace stlsoft 00130 # endif /* _STLSOFT_NO_NAMESPACE */ 00131 #endif /* !RANGELIB_NO_NAMESPACE */ 00132 00133 /* ////////////////////////////////////////////////////////////////////// */ 00134 00135 #endif /* !RANGELIB_INCL_RANGELIB_HPP_FILTERED_SEQUENCE */ 00136 00137 /* ///////////////////////////// end of file //////////////////////////// */