Skip to content

Instantly share code, notes, and snippets.

View vitonzhangtt's full-sized avatar
😴
Be sleeping in the winter

vitonzhangtt

😴
Be sleeping in the winter
View GitHub Profile
@vitonzhangtt
vitonzhangtt / Producer.swift
Last active October 22, 2021 13:04
Notes on RxSwift 5.x Source
//
// Producer.swift
// RxSwift
//
// Created by Krunoslav Zaher on 2/20/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
class Producer<Element> : Observable<Element> {
override init() {
@vitonzhangtt
vitonzhangtt / StructWithInnerReference.swift
Created November 3, 2021 10:20
The assignment operation of struct variable with inner reference.
// Inner Reference Type
final internal class CoWInnerClass {
var identifier: Int
init(_ id: Int) {
identifier = id
}
}
// The struct with inner reference type.
struct CoWValueWithRef: CustomStringConvertible {
@vitonzhangtt
vitonzhangtt / Driver.cpp
Last active June 30, 2022 08:02
Driver.cpp in oclint-22.02
/*-
* This code is derived from
* http://llvm.org/svn/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp
* with the following license:
*
* University of Illinois/NCSA
* Open Source License
*
* Copyright (c) 2003-2013 University of Illinois at Urbana-Champaign.
* All rights reserved.
@vitonzhangtt
vitonzhangtt / CompilerInstance.cpp
Last active July 4, 2022 04:06
CompilerInstance.cpp in oclint-22.02
#include "oclint/CompilerInstance.h"
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/FrontendActions.h>
#include <clang/StaticAnalyzer/Frontend/FrontendActions.h>
#include "oclint/Options.h"
using namespace oclint;
@vitonzhangtt
vitonzhangtt / RecursiveASTVisitor.h
Created July 18, 2022 17:07
The result of preprocessing RecursiveASTVisitor.h using clang -E.
This file has been truncated, but you can view the full file.
namespace clang {
namespace detail {
template <typename T, typename U>
struct has_same_member_pointer_type : std::false_type {};
template <typename T, typename U, typename R, typename... P>
struct has_same_member_pointer_type<R (T::*)(P...), R (U::*)(P...)>
: std::true_type {};
template <bool has_same_type> struct is_same_method_impl {
template <typename FirstMethodPtrTy, typename SecondMethodPtrTy>
static bool isSameMethod(FirstMethodPtrTy FirstMethodPtr,