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 <vector> | |
using namespace std; | |
template<typename T> void draw(const T& x, ostream& out, size_t position); | |
class object_t { | |
public: | |
template<typename T> object_t(T x) : self_(make_unique<model<T>>(move(x))) {} |
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
void draw(const my_class_t&, ostream& out, size_t position) | |
{ | |
out << string (position, ' ') << "my_class_t" << endl; | |
} | |
int main() { | |
document_t document; | |
document.reserve(5); | |
document.emplace_back(my_class_t()); |
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 <vector> | |
using namespace std; | |
template <typename T> | |
void draw(const T& x, ostream& out, size_t position) | |
{ | |
out << string(position, ' ') << x << endl; | |
} |
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
/* | |
Copyright (C) 2016 Apple Inc. All Rights Reserved. | |
See LICENSE.txt for this sample’s licensing information | |
Abstract: | |
A struct for accessing generic password keychain items. | |
*/ | |
import Foundation |
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
import SwiftUI | |
enum ButtonState { | |
case pressed | |
case notPressed | |
} | |
struct PressedModifier: ViewModifier { | |
@GestureState private var isPressed = false | |
let changeState: (ButtonState) -> Void |
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
// | |
// KeychainWrapper.swift | |
// | |
// Created by Oliver Epper on 27.05.20. | |
// Copyright © 2020 Oliver Epper. All rights reserved. | |
// | |
import Foundation | |
// This is a stripped down version of SwiftKeychainWraper |
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
import Foundation | |
enum OneOff {} | |
enum Sustained {} | |
struct KuandoCommand<Kind>: ExpressibleByArrayLiteral { | |
typealias ArrayLiteralElement = UInt8 | |
private(set) var data = [ArrayLiteralElement](repeating: 0, count: 64) |
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
struct ContentView: View { | |
@State private var oben = false | |
var body: some View { | |
VStack { | |
if oben { | |
Text("HA").id(4) | |
Spacer() | |
} else { | |
Spacer() |
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
// | |
// Created by Oliver Epper on 16.02.21. | |
// | |
// | |
import Combine | |
import Foundation | |
final class ReadOperation: Operation { | |
enum ReadOperationError: 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
import Foundation | |
import Combine | |
class LinePublisherSubscription<S: Subscriber>: Subscription where S.Input == String, S.Failure == LinePublisher.Error { | |
let url: URL | |
let linesToRead: Int? | |
var subscriber: S? | |
var openDemand = Subscribers.Demand.none |