Caffe2 - C++ API
A deep learning, cross platform ML framework
arg.h
1 #pragma once
2 
3 #include <utility>
4 
5 #define TORCH_ARG(T, name) \
6  auto name(const T& new_##name)->decltype(*this) { /* NOLINT */ \
7  this->name##_ = new_##name; \
8  return *this; \
9  } \
10  auto name(T&& new_##name)->decltype(*this) { /* NOLINT */ \
11  this->name##_ = std::move(new_##name); \
12  return *this; \
13  } \
14  const T& name() const noexcept { /* NOLINT */ \
15  return this->name##_; \
16  } \
17  T name##_ /* NOLINT */