Commit 960fca4a authored by Quentin Khan's avatar Quentin Khan
Browse files

FBasicParticle: add 'attribute' template method to get specific attribute

parent 2bd669db
......@@ -168,6 +168,26 @@ public:
return setPosition_impl(pos, std::make_index_sequence<Dim>());
}
/**
* \brief Get a reference to the Ith attribute
*
* \tparam I Index of the attribute to get
*/
template<std::size_t I>
auto attribute() -> decltype(std::get<Dim+I>(*this)) {
return std::get<Dim+I>(*this);
}
/**
* \brief Get a const reference to the Ith attribute
*
* \tparam I Index of the attribute to get
*/
template<std::size_t I>
auto attribute() const -> decltype(std::get<Dim+I>(*this)) {
return std::get<Dim+I>(*this);
}
/**
* \brief Get a tuple filled with copies of the attributes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment