My Project
Classes | Functions
move.hpp File Reference
#include "remove_reference.hpp"

Go to the source code of this file.

Classes

class  bsl::fmt< V >
 The bsl::fmt implements a similar syntax to that of std::format, We adopt a similar approach with some tweaks of course to ensure AUTOSAR compliance include: More...
 

Functions

template<typename T >
constexpr bsl::remove_reference_t< T > && bsl::move (T &&val) noexcept
 Used to indicate that an object "val" may be "moved from", i.e. allowing the efficient transfer of resources from "val" to another object. More...
 
template<typename V >
constexpr void bsl::move (fmt< V > &&val) noexcept=delete
 Used to prevent a move of bsl::fmt as it must always be a temporary r-value. More...
 

Detailed Description

Function Documentation

◆ move() [1/2]

template<typename T >
constexpr bsl::remove_reference_t<T>&& bsl::move ( T &&  val)
noexcept

Used to indicate that an object "val" may be "moved from", i.e. allowing the efficient transfer of resources from "val" to another object.

#include <bsl/move.hpp>
#include <bsl/debug.hpp>
namespace bsl
{
inline void
example_move_overview() noexcept
{
bool val1{true};
bool const &&val2{bsl::move(val1)};
if (val2) {
bsl::print() << "success\n";
}
}
}

SUPPRESSION: PRQA 4624 - false positive

  • We suppress this because A7-5-1 states that a function shall not return a pointer or reference to a parameter that is a const reference, and this is a false positive because this is the required definition for std::move
Template Parameters
Tthe type that defines the value being moved
Parameters
valthe value being moved
Returns
returns an xvalue expression that identifies "val"

◆ move() [2/2]

template<typename V >
constexpr void bsl::move ( fmt< V > &&  val)
deletenoexcept

Used to prevent a move of bsl::fmt as it must always be a temporary r-value.

Template Parameters
Vthe type of value being formatted for output
Parameters
valthe value being moved