diff options
-rw-r--r-- | src/filters/pipe.cpp | 7 | ||||
-rw-r--r-- | src/filters/pipe.h | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/filters/pipe.cpp b/src/filters/pipe.cpp index 33824be24..d43868e3f 100644 --- a/src/filters/pipe.cpp +++ b/src/filters/pipe.cpp @@ -51,11 +51,12 @@ Pipe::Pipe(Filter* f1, Filter* f2, Filter* f3, Filter* f4) /* * Pipe Constructor */ -Pipe::Pipe(Filter* filter_array[], u32bit count) +Pipe::Pipe(std::initializer_list<Filter*> args) { init(); - for(u32bit j = 0; j != count; ++j) - append(filter_array[j]); + + for(auto i = args.begin(); i != args.end(); ++i) + append(*i); } /* diff --git a/src/filters/pipe.h b/src/filters/pipe.h index 120f2fbdd..7cf7d6df2 100644 --- a/src/filters/pipe.h +++ b/src/filters/pipe.h @@ -11,6 +11,7 @@ #include <botan/data_src.h> #include <botan/filter.h> #include <botan/exceptn.h> +#include <initializer_list> #include <iosfwd> namespace Botan { @@ -238,11 +239,11 @@ class BOTAN_DLL Pipe : public DataSource Pipe(Filter* = 0, Filter* = 0, Filter* = 0, Filter* = 0); /** - * Construct a Pipe from range of filters passed as an array + * Construct a Pipe from a list of filters * @param filters the set of filters to use - * @param count the number of elements in filters */ - Pipe(Filter* filters[], u32bit count); + Pipe(std::initializer_list<Filter*> filters); + ~Pipe(); private: Pipe(const Pipe&) : DataSource() {} |