RESTinio
Loading...
Searching...
No Matches
Namespaces | Functions
restinio::utils::impl::bitops Namespace Reference

Namespaces

namespace  details
 

Functions

template<typename T , unsigned Shift, unsigned Bits_To_Extract = details::bits_count<T>::count, typename F = unsigned int>
n_bits_from (F value)
 Extract N bits from a bigger integer value.
 

Function Documentation

◆ n_bits_from()

template<typename T , unsigned Shift, unsigned Bits_To_Extract = details::bits_count<T>::count, typename F = unsigned int>
T restinio::utils::impl::bitops::n_bits_from ( F  value)

Extract N bits from a bigger integer value.

Usage example:

// Extract 8 bits as unsigned char from bits 24..31 in uint32_t.
const std::uint32_t v1 = some_uint_value();
// Extract 6 bits as char from bits 12..17 in uint32_t.
// Extract 4 bits as unsigned int from bits 32..35 in uint64_t.
const std::uint64_t v2 = some_uint64_value();
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.

Definition at line 86 of file bitops.hpp.