argument.hpp 365 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef GUARD_RTGLIB_ARGUMENT_HPP
#define GUARD_RTGLIB_ARGUMENT_HPP

#include <rtg/shape.hpp>
#include <functional>

namespace rtg {

struct argument
{
    std::function<char*()> data;
    shape s;

    template<class Visitor>
    void visit(Visitor v) const
    {
        s.visit_type([&](auto as) {
            v(as.from(data()));
        });
    }
};

}

#endif