oven::copied

oven::copiedは範囲を他の型の範囲にコピーする範囲アルゴリズムです。

#include <cassert>
#include <vector>
#include <pstade/oven/copied.hpp>
#include <pstade/oven/initial_values.hpp>
#include <pstade/oven/equals.hpp>

using namespace pstade::oven;

int main()
{
    const int ar[] = {3, 1, 4};
    const std::vector<int> v = ar|copied;

    assert(equals(v, initial_values(3, 1, 4)));
}

このプログラムの場合、

const std::vector<int> v = ar|copied;

const std::vector<int> v(boost::begin(ar), boost::end(ar));

を意味し、範囲を指定するコンストラクタを呼び出します。


【参照】
pstade::oven::copied