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
| /* | |
| TWO ways: 1) dmd -c importer.d | |
| 2) dmd -c -unittest importer.d | |
| */ | |
| import importme; // *importme.d* is opened and semantic analysis on *importme.d* begins; | |
| // now you should follow the comments from *importme.d* | |
| //imports are solved now; semantic analysis continues | |
| void main() |
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 mod; | |
| struct Public { | |
| int oops() { | |
| return 42; | |
| } | |
| } | |
| struct Nope { |
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
| // This is only here to write a blog about it later | |
| @("struct.onefield.int.manual") | |
| @MockTU!( | |
| { | |
| import clang; | |
| return MockCursor( | |
| Cursor.Kind.TranslationUnit, | |
| "", | |
| MockType(), | |
| [ |
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 <stdlib.h> | |
| #include <time.h> | |
| #include <sys/time.h> | |
| #include <stdio.h> | |
| #define SIZE (50 * 1000 * 1000) | |
| int data[SIZE]; | |
| void init(int* data, int len) { |
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
| extern(C++) class Foo { | |
| void stuff() { | |
| import core.stdc.stdio; | |
| printf("I'm foo!\n"); | |
| } | |
| } | |
| extern(C++) class Bar: Foo { | |
| override void stuff() { | |
| import core.stdc.stdio; |
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
| template<typename T> | |
| struct Foo { | |
| T value; | |
| T twice() const { return value * 2; } | |
| }; | |
| #if __clang__ | |
| [[clang::optnone]] | |
| #elif __GNUC__ |
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 std.stdio; | |
| unittest { | |
| writeln("mod1 test1"); | |
| } | |
| unittest { | |
| writeln("mod1 test2"); | |
| } |
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 std.traits; | |
| template Identity(alias T) { | |
| alias Identity = T; | |
| } | |
| template InterfaceToStruct(T) if(is(T == interface)) { | |
| string mixinStr() { |
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 std.meta; | |
| auto leftFold(alias F, alias T, Ts...)() { | |
| auto leftFoldImpl(U, V, Vs...)(U accum, V value, Vs values) { | |
| static if(values.length == 0) | |
| return F(accum, value); | |
| else | |
| return leftFoldImpl(F(accum, value), 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
| ;;; init.el --- Atila Neves's custom emacs config | |
| ;; Copyright (C) 2013 | |
| ;; Author: <[email protected]> | |
| ;; Keywords: init | |
| ;; This program is free software; you can redistribute it and/or modify | |
| ;; it under the terms of the GNU General Public License as published by | |
| ;; the Free Software Foundation, either version 3 of the License, or |
NewerOlder