📄 tr1.qbk
字号:
bool regex_match(const basic_string<charT, ST, SA>& s, match_results<typename basic_string<charT, ST, SA>::const_iterator,Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class charT, class traits> bool regex_match(const charT* str, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class ST, class SA, class charT, class traits> bool regex_match(const basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); // [7.11.3] Function template regex_search template <class BidirectionalIterator, class Allocator, class charT, class traits> bool regex_search(BidirectionalIterator first, BidirectionalIterator last, match_results<BidirectionalIterator, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class BidirectionalIterator, class charT, class traits> bool regex_search(BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class charT, class Allocator, class traits> bool regex_search(const charT* str, match_results<const charT*, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class charT, class traits> bool regex_search(const charT* str, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class ST, class SA, class charT, class traits> bool regex_search(const basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template <class ST, class SA, class Allocator, class charT, class traits> bool regex_search(const basic_string<charT, ST, SA>& s, match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); // [7.11.4] Function template regex_replace template <class OutputIterator, class BidirectionalIterator, class traits, class charT> OutputIterator regex_replace(OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, const basic_string<charT>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); template <class traits, class charT> basic_string<charT> regex_replace(const basic_string<charT>& s, const basic_regex<charT, traits>& e, const basic_string<charT>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); // [7.12.1] Class template regex_iterator template <class BidirectionalIterator, class charT = typename iterator_traits<BidirectionalIterator>::value_type, class traits = regex_traits<charT> > class regex_iterator; typedef regex_iterator<const char*> cregex_iterator; typedef regex_iterator<const wchar_t*> wcregex_iterator; typedef regex_iterator<string::const_iterator> sregex_iterator; typedef regex_iterator<wstring::const_iterator> wsregex_iterator; // [7.12.2] Class template regex_token_iterator template <class BidirectionalIterator, class charT = typename iterator_traits<BidirectionalIterator>::value_type, class traits = regex_traits<charT> > class regex_token_iterator; typedef regex_token_iterator<const char*> cregex_token_iterator; typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator; typedef regex_token_iterator<string::const_iterator> sregex_token_iterator; typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator; } // namespace tr1 } // namespace std [*Configuration:][@../../libs/config/index.html Boost.Config] should (automatically) definethe macro BOOST_HAS_TR1_REGEX if yourstandard library implements this part of TR1.[*Standard Conformity:]No known problems.[endsect][section:complex Complex Number Algorithm Overloads.] #include <boost/tr1/complex.hpp> or #include <complex> The following function templates have additional overloads: `arg`, `norm`, `conj`, `polar`, `imag`, and `real`.The additional overloads are sufficient to ensure:*If the argument has type `long double`, then the overload behaves as if the argument had been cast to `std::complex<long double>`.*Otherwise, if the argument has type `double` or is an integer type, then the overload behaves as if the argument had been cast to `std::complex<double>`.*Otherwise, if the argument has type `float`, then the overload behaves as if the argument had been cast to `std::complex<float>`.The function template `pow` has additional overloads sufficient to ensure, for a call with at least one argument of type `std::complex<T>`:*If either argument has type `complex<long double>` or type `long double`, then the overload behaves as if both arguments were castto `std::complex<long double>`*Otherwise, if either argument has type `complex<double>`, `double`, or an integer type, then the overload behaves as if both arguments were castto `std::complex<double>`*Otherwise, if either argument has type `complex<float>` or `float`, then the overload behaves as if both arguments were castto `std::complex<float>`In the following synopsis, `Real` is a floating point type,`Arithmetic` is an integer or floating point type, and `PROMOTE(X1 ... XN)` is the largest floating point type in the listX1 to XN, after any non-floating point types in the list have been replaced bythe type `double`. template <class Arithmetic> PROMOTE(Arithmetic) arg(const Arithmetic& t); template <class Arithmetic> PROMOTE(Arithmetic) norm(const Arithmetic& t); template <class Arithmetic> complex<PROMOTE(Arithmetic)> conj(const Arithmetic& t); template <class Arithmetic1, class Arithmetic2> complex<PROMOTE(Arithmetic1,Arithmetic2)> polar(const Arithmetic1& rho, const Arithmetic2& theta = 0); template <class Arithmetic> PROMOTE(Arithmetic) imag(const Arithmetic& ); template <class Arithmetic> PROMOTE(Arithmetic) real(const Arithmetic& t); template<class Real1, class Real2> complex<PROMOTE(Real1, Real2)> pow(const complex<Real1>& x, const complex<Real2>& y); template<class Real, class Arithmetic> complex<PROMOTE(Real, Arithmetic)> pow (const complex<Real>& x, const Arithmetic& y); template<class Arithmetic, class Real> complex<PROMOTE(Real, Arithmetic)> pow (const Arithmetic& x, const complex<Real>& y); [*Configuration:][@../../libs/config/index.html Boost.Config] should (automatically) definethe macro BOOST_HAS_TR1_COMPLEX_OVERLOADS if yourstandard library implements the additional overloads for the existingcomplex arithmetic functions.[*Standard Conformity:]No known problems.[endsect][section:complex_trig Complex Number Additional Algorithms.] #include <boost/tr1/complex.hpp> or #include <complex>The algorithms `acos`, `asin`, `atan`, `acosh`, `asinh`, `atanh` and `fabs`are overloaded for arguments of type `std::complex<T>`. These algorithms are entirelyclassical, and behave as specified in the C99 standard section 7.3.5.See the [@../../libs/math/doc/complex/html/complex_number_tr1_algorithms/inverse_complex.html Boost.Math documentation for more information]. namespace std { namespace tr1 { template<class T> complex<T> acos(complex<T>& x); template<class T> complex<T> asin(complex<T>& x); template<class T> complex<T> atan(complex<T>& x); template<class T> complex<T> acosh(complex<T>& x); template<class T> complex<T> asinh(complex<T>& x); template<class T> complex<T> atanh(complex<T>& x); template<class T> complex<T> fabs(complex<T>& x); } // namespace tr1 } // namespace std[*Configuration:][@../../libs/config/index.html Boost.Config] should (automatically) definethe macro BOOST_HAS_TR1_COMPLEX_INVERSE_TRIGif your standard library implements the additional inverse trig functions.[*Standard Conformity:]No known problems.[endsect][section:unordered_set Unordered Associative Set (Hash Table).] #include <boost/tr1/unordered_set.hpp> or #include <unordered_set>For accessing data based on key lookup, the C++ standard library offers std::set, std::map, std::multiset and std::multimap. These are generally implemented using balanced binary trees so that lookup time has logarithmic complexity. That is generally okay, but in many cases a hash table can perform better, as accessing data has constant complexity, on average. The worst case complexity is linear, but that occurs rarely and with some care, can be avoided.With this in mind, the C++ Standard Library Technical Report introduced the unordered associative containers, which are implemented using hash tables, and they have now been added to the Working Draft of the C++ Standard. Refer to the [@../../libs/unordered/index.html Unordered Library docs] for more information. namespace std { namespace tr1 { template <class Value, class Hash = hash<Value>, class Pred = std::equal_to<Value>, class Alloc = std::allocator<Value> > class unordered_set; // [6.3.4.5] Class template unordered_multiset template <class Value, class Hash = hash<Value>, class Pred = std::equal_to<Value>, class Alloc = std::allocator<Value> > class unordered_multiset; template <class Value, class Hash, class Pred, class Alloc> void swap(unordered_set<Value, Hash, Pred, Alloc>& x, unordered_set<Value, Hash, Pred, Alloc>& y); template <class Value, class Hash, class Pred, class Alloc> void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x, unordered_multiset<Value, Hash, Pred, Alloc>& y); } // namespace tr1 } // namespace std[*Configuration:][@../../libs/config/index.html Boost.Config] should (automatically) definethe macro BOOST_HAS_TR1_UNORDERED_SET if yourstandard library implements this part of TR1.[*Standard Conformity:]No known issues for conforming compilers.[endsect][section:unordered_map Unordered Associative Map (Hash Table).] #include <boost/tr1/unordered_map.hpp> or #include <unordered_map> For accessing data based on key lookup, the C++ standard library offers std::set, std::map, std::multiset and std::multimap. These are generally implemented using balanced binary trees so that lookup time has logarithmic complexity. That is generally okay, but in many cases a hash table can perform better, as accessing data has constant complexity, on average. The worst case complexity is linear, but that occurs rarely and with some care, can be avoided.With this in mind, the C++ Standard Library Technical Report introduced the unordered associative containers, which are implemented using hash tables, and they have now been added to the Working Draft of the C++ Standard. Refer to the [@../../libs/unordered/index.html Unordered Library docs] for more information. namespace std { namespace tr1 { // [6.3.4.4] Class template unordered_map template <class Key, class T, class Hash = hash<Key>, class Pred = std::equal_to<Key>, class Alloc = std::allocator<std::pair<const Key, T> > > class unordered_map; // [6.3.4.6] Class template unordered_multimap template <class Key, class T, class Hash = hash<Key>, class Pred = std::equal_to<Key>, class Alloc = std::allocator<std::pair<const Key, T> > > class unordered_multimap; template <class Key, class T, class Hash, class Pred, class Alloc> void swap(unordered_map<Key, T, Hash, Pred, Alloc>& x, unordered_map<Key, T, Hash, Pred, Alloc>& y); template <class Key, class T, class Hash, class Pred, class Alloc> void swap(unordered_multimap<Key, T, Hash, Pred, Alloc>& x, unordered_multimap<Key, T, Hash, Pred, Alloc>& y); } // namespace tr1 } // namespace std[*Configuration:][@../../libs/config/index.html Boost.Config] should (automatically) definethe macro BOOST_HAS_TR1_UNORDERED_MAP if yourstandard library implements this part of TR1.[*Standard Conformity:]No known issues for conforming compilers.[endsect][section:special Mathematical Special Functions.]The TR adds 23 special functions (plus float and long double overloads)to header <cmath>.Refer to the [@../../libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/tr1.html Math Library docs] for more information. namespace std { namespace tr1 { // [5.2.1.1] associated Laguerre polynomials: double assoc_laguerre(unsigned n, unsigned m, double x); float assoc_laguerref(unsigned n, unsigned m, float x); long double assoc_laguerrel(unsigned n, unsigned m, long double x);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -