as
has a few different contexts in Rust:
This file contains 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 <future> | |
#include <tuple> | |
#include <type_traits> | |
#include <utility> | |
template <typename F> | |
class Composable; | |
template <typename R, bool NoExcept> | |
class AsyncComposable; |
This file contains 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
#ifndef BETTER_CASTS_HPP | |
#define BETTER_CASTS_HPP | |
#include <limits> | |
#include <stdexcept> | |
#include <type_traits> | |
#include <utility> | |
#if __cplusplus >= 201703L | |
# define INLINE_CONSTEXPR inline constexpr |
This file contains 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 <memory> | |
#include <type_traits> | |
#include <utility> | |
namespace not_std | |
{ | |
template<typename T> | |
constexpr T default_getter(const T& val) noexcept | |
{ |
This file contains 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
if(WIN32) | |
set(TARGET_WINDOWS TRUE) | |
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") | |
set(CXX_MSVC TRUE) | |
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | |
set(CXX_MINGW TRUE) | |
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
set(CXX_CLANG TRUE) | |
endif() | |
elseif(UNIX AND NOT APPLE) |
This file contains 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
--- | |
BasedOnStyle: Microsoft | |
AccessModifierOffset: -4 | |
AlignAfterOpenBracket: DontAlign | |
AlignConsecutiveAssignments: None | |
AlignConsecutiveBitFields: true # 11 | |
AlignConsecutiveDeclarations: None | |
AlignEscapedNewlines: Left | |
AlignOperands: DontAlign |
This file contains 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> | |
template<typename T> | |
void printStuff1() | |
{ | |
if constexpr(std::is_pointer_v<T>) | |
{ | |
std::cout << "POINTER\n"; | |
} |
This file contains 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
#pragma once | |
#include <condition_variable> | |
#include <mutex> | |
#include <queue> | |
template <typename T> | |
class queue_mt | |
{ | |
public: |
This file contains 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
#pragma once | |
#include <type_traits> | |
namespace jjh | |
{ | |
// Custom because 'custom' is true | |
class CustomClass1 | |
{ | |
public: |