This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template<typename... Args> | |
struct data_structure_t | |
{ | |
}; | |
template<typename Type, typename ... Args> | |
struct data_structure_t<Type, Args ...> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <type_traits> | |
// struct a version 1 | |
struct a_version1 { | |
a_version1(const int a1, const int a2) : m_a1{a1}, m_a2{a2} {} | |
int do_some_ops(const int x, const int y) const { | |
return x * m_a1 + y * m_a2; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <limits> | |
#include <bitset> | |
#include <bit> | |
#include <cassert> | |
inline std::size_t count_bits(const unsigned long long n) noexcept { | |
return std::bitset<std::numeric_limits<unsigned long long>::digits>{n}.count(); | |
} | |
inline constexpr unsigned int foat_to_binary(float f) noexcept { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <numeric> | |
struct distance_t | |
{ | |
// factory constructors for creating a distance | |
friend distance_t constexpr operator "" _km(const long double data); | |
friend distance_t constexpr operator "" _m(const long double data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string_view> | |
#include <fmt/core.h> | |
#include <source_location> | |
#include <iostream> | |
#include <thread> | |
template <typename ...Args> | |
struct LOG_ERROR | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string_view> | |
#include <fmt/core.h> | |
#include <source_location> | |
#include <iostream> | |
#include <thread> | |
template <typename ...Args> | |
struct LOG_ERROR | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template<typename... Values> | |
auto minus(Values const&... values) | |
{ | |
return (values - ...); | |
//(1 - (2 - 3)) | |
} | |
template<typename... Values> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <utility> | |
#include <cassert> | |
template <int n> | |
struct fibonacci | |
{ | |
static constexpr int value{fibonacci<n-1>::value + fibonacci<n-2>::value}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string_view> | |
#include <fmt/core.h> | |
#include <source_location> | |
template <typename ...Args> | |
struct LOG_ERROR | |
{ | |
constexpr LOG_ERROR( | |
Args&& ...args, |