Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
momentum::DeduceSpanType< T > Struct Template Reference

A utility struct that facilitates the deduction of a momentum::span type from a given type. More...

#include <types.h>

Public Types

using type = momentum::span<T>

Detailed Description

template<typename T>
struct momentum::DeduceSpanType< T >

A utility struct that facilitates the deduction of a momentum::span type from a given type.

This utility is particularly useful when a function accepts a momentum::span<Vector3<T>> as an argument, where the template argument of momentum::span is also a template. In such cases, direct deduction of the momentum::span type from other container types (e.g., std::vector<Vector3<T>>) at the call site may fail.

By using this utility, the appropriate momentum::span type can be deduced automatically, ensuring smoother function calls and enhancing code readability.

Example usage:

void foo(DeduceSpanType<Vector3f>::type points); // Equivalent to momentum::span<Vector3f>
std::vector<Vector3f> points;
foo(points); // This line will compile without any issues.
momentum::span< T > type
Definition types.h:454
Note
The momentum::span generated by this utility gives a mutable view into the sequence. If an immutable view is needed, consider using momentum::span<const T> instead.

Definition at line 453 of file types.h.

Member Typedef Documentation

◆ type

template<typename T>
using momentum::DeduceSpanType< T >::type = momentum::span<T>

Definition at line 454 of file types.h.


The documentation for this struct was generated from the following file: