Daniel Kolesa
c287d7e98a
push_front is only necessary on bidir ranges or better now
2015-06-14 04:53:38 +01:00
Daniel Kolesa
6b2a7fb43c
avoid copies
2015-06-09 23:07:53 +01:00
Daniel Kolesa
40b52ed765
more efficient sort
2015-06-09 22:56:40 +01:00
Daniel Kolesa
23261d6d5b
no typename necessary
2015-06-07 18:12:07 +01:00
Daniel Kolesa
548de69102
add octa::FunctionMakeDefaultConstructible, use in MapRange and FilterRange
...
This turns any callable object into a primitive default constructible type.
That is, for regular function objects, the type represents the object type
itself, for function pointers, the type represents the function pointer,
for simple lambdas the type represents a function pointer they map to
(only when the lambda doesn't capture) and for closures it represents
the right octa::Function type.
2015-06-07 18:07:48 +01:00
Daniel Kolesa
f4ca222dbd
remove duplicate code + further simplify
2015-06-07 16:32:32 +01:00
Daniel Kolesa
1d47ac26a8
simplify func checks
2015-06-07 16:17:03 +01:00
Daniel Kolesa
ee8d565203
optimize/specialize filter func in a similar way to map func
2015-06-07 16:12:14 +01:00
Daniel Kolesa
44e07b8e6b
no need to do convertible checks as that's already done previously
2015-06-07 15:50:33 +01:00
Daniel Kolesa
93652ed81f
fix octa::MapRange func type checks for regular functors
2015-06-07 15:49:08 +01:00
Daniel Kolesa
36d9a35066
for MapRange, specialize stored func in a few ways to avoid octa::Function (and thus avoid the significant overhead it brings)
2015-06-07 04:31:18 +01:00
Daniel Kolesa
84d78ba87a
deuglify template args
2015-06-04 22:57:06 +01:00
Daniel Kolesa
d442ba2508
deassify algorithm.h
2015-06-03 22:54:18 +01:00
Daniel Kolesa
ae05420994
get rid of __Octa/__octa in algorithm
2015-06-03 22:43:39 +01:00
Daniel Kolesa
49b9a8d17f
add octa::make_pair and octa::exchange
2015-06-02 02:01:32 +01:00
Daniel Kolesa
bfc94e31d7
uglify the code by using unique identifiers only (prevent macro conflicts)
2015-06-02 00:57:34 +01:00
Daniel Kolesa
67600c4637
first -> front, last -> back
2015-06-01 01:13:37 +01:00
Daniel Kolesa
3c6ef6e593
initial support for "range halves" ("range iterator")
2015-05-29 23:32:25 +01:00
Daniel Kolesa
15507e0143
remove useless equality/inequality operators on ranges
2015-05-29 21:49:07 +01:00
Daniel Kolesa
a54db37a9c
get const right on ranges
2015-05-29 20:21:35 +01:00
Daniel Kolesa
26f83b9efb
pop_first() and pop_last() now return bool instead of void (true if popped, false if not)
2015-05-29 20:02:40 +01:00
Daniel Kolesa
38fc61481a
initial support for "range extension" - i.e. push_first and push_last methods (+ push_first_n, push_last_n)
2015-05-29 19:52:20 +01:00
Daniel Kolesa
c1be7f097d
various ToString improvements
2015-05-28 19:58:05 +01:00
Daniel Kolesa
08bb790612
stl-like initializer list interface (allow octastd to be used with stl outside of octaforge)
2015-05-27 23:46:58 +01:00
Daniel Kolesa
1371a32db7
use size() instead of length()
2015-05-27 23:19:16 +01:00
Daniel Kolesa
28828ff448
fix swap_ranges api to correctly handle differently sized ranges
2015-05-27 00:49:35 +01:00
Daniel Kolesa
ea83f402ab
octa::algorithm::{foldl,foldr}
2015-05-25 20:46:49 +01:00
Daniel Kolesa
ffbb7da63a
unexpose insertion sort
2015-05-24 18:22:35 +01:00
Daniel Kolesa
96d2404c0e
allow different return type for octa::map callbacks
2015-05-24 14:34:37 +01:00
Daniel Kolesa
b2f085b9da
more accurate range category for FilterRange
2015-05-24 14:16:20 +01:00
Daniel Kolesa
8718630a5a
il.range() -> il.each(), add algorithm::filter(range, pred)
2015-05-24 02:31:54 +01:00
Daniel Kolesa
523c0e0ad1
const correctness
2015-05-23 18:59:14 +01:00
Daniel Kolesa
7c91e1cc5b
implement random access requirements on MapRange
2015-05-23 18:55:22 +01:00
Daniel Kolesa
8c96179bd6
add octa::algorithm::map
2015-05-23 18:44:06 +01:00
Daniel Kolesa
2d10cd9280
ditch RangeTraits for alias definitions
2015-05-03 21:54:26 +01:00
Daniel Kolesa
e98b8946ae
define size_type for ranges
2015-04-27 19:53:48 +01:00
Daniel Kolesa
d7778cf259
ditch the separate "type" struct
2015-04-27 19:38:34 +01:00
Daniel Kolesa
b37921ee93
add octa::clamp
2015-04-26 18:45:10 +01:00
Daniel Kolesa
f106c5ae24
get rid of namespace internal
2015-04-24 18:16:35 +01:00
Daniel Kolesa
87e324bb1c
traits::enable_if, algorithm::iota
2015-04-21 23:54:26 +01:00
Daniel Kolesa
6807d22df5
satisfy OutputRange on MoveRange and PointerRange (might be mutable), add more algorithms
2015-04-21 17:56:36 +01:00
Daniel Kolesa
ab95885b4a
add more algorithms
2015-04-21 02:33:58 +01:00
Daniel Kolesa
d68d381f72
move initializer lists into initializer_list.h + add new .range() method to retrieve a PointerRange to it
2015-04-20 19:06:47 +01:00
Daniel Kolesa
9885909485
add algorithm::all_of, any_of, none_of
2015-04-20 02:21:27 +01:00
Daniel Kolesa
6d60b051e8
add algorithm::for_each
2015-04-20 02:14:55 +01:00
Daniel Kolesa
c4aa7242fc
add algorithm::is_partitioned
2015-04-20 02:06:42 +01:00
Daniel Kolesa
58063fe392
add min, max, min_element, max_element in algorithm.h; rename VectorRange to PointerRange and move to range.h (useful as generic, e.g. with InitializerList)
2015-04-19 00:04:17 +01:00
Daniel Kolesa
c36a653824
use introsort for sorting
2015-04-18 23:12:45 +01:00
Daniel Kolesa
f9a298c1b8
move quicksort to internal namespace
2015-04-18 22:43:20 +01:00
Daniel Kolesa
4850e2454f
don't use lambda
2015-04-18 22:40:38 +01:00