OSVR-Core
RangeTransform.h
Go to the documentation of this file.
1 
11 // Copyright 2016 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_RangeTransform_h_GUID_94F5FF2F_27AC_44A5_FE5A_F9294C3DCCEB
26 #define INCLUDED_RangeTransform_h_GUID_94F5FF2F_27AC_44A5_FE5A_F9294C3DCCEB
27 
28 // Internal Includes
29 // - none
30 
31 // Library/third-party includes
32 // - none
33 
34 // Standard includes
35 #include <algorithm>
36 #include <iterator>
37 #include <utility>
38 
39 namespace osvr {
40 namespace vbtracker {
43  template <typename Container, typename OutIter, typename Func>
44  inline OutIter range_transform(Container &&c, OutIter dest, Func &&f) {
45  using std::begin;
46  using std::end;
47  return std::transform(begin(std::forward<Container>(c)),
48  end(std::forward<Container>(c)), dest,
49  std::forward<Func>(f));
50  }
51 } // namespace vbtracker
52 } // namespace osvr
53 
54 #endif // INCLUDED_RangeTransform_h_GUID_94F5FF2F_27AC_44A5_FE5A_F9294C3DCCEB
OutIter range_transform(Container &&c, OutIter dest, Func &&f)
Wrapper for std::transform that does the begin and end business for us.
Definition: RangeTransform.h:44
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
t_< detail::transform_< List, Fun >> transform
Given a list and an alias class, apply the alias class to each element in the list and return the res...
Definition: Transform.h:54