Created
October 10, 2017 15:03
-
-
Save MrSmith33/dc53d8cb6ce642fcb6dbc5863d029cec to your computer and use it in GitHub Desktop.
unresolved external symbol internal. (Smaller test case)
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
// dmd -m64 -lib -of="lib.lib" -debug -g -w -I="./" texteditor.d | |
// dmd -m64 -of="app.exe" -debug -g -w -I="./" lib.lib main.d | |
import texteditor; | |
void main() {} |
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
module texteditor; | |
class EditorTextModel | |
{ | |
TextEditor* editor; | |
ChunkedRange!char opSlice(size_t from, size_t to) { return editor.textData[from..to].toChunkedRange; } | |
void replaceSelection(const(char)[] str) { editor.replaceSelection(str); } | |
} | |
struct TextEditor | |
{ | |
private PieceTable textData; | |
mixin ReadHelpers!(); | |
mixin WriteHelpers!(); | |
} | |
mixin template ReadHelpers() | |
{ | |
import std.datetime : MonoTime; | |
} | |
mixin template WriteHelpers() | |
{ | |
void replaceSelection(const(char)[] str) {} | |
} | |
private struct Piece { size_t bufferOffset; } | |
struct PieceRestoreRange {} | |
private struct PieceStorage | |
{ | |
Piece* sentinel = new Piece; | |
PieceRestoreRange insertAt(Piece* newPiece, size_t insertPos) | |
{ | |
return PieceRestoreRange(); | |
} | |
} | |
struct PieceTable | |
{ | |
PieceStorage pieces; | |
Range!char opSlice(size_t x, size_t y) { return Range!char(); } | |
size_t length() @property { return 0; } | |
} | |
private struct Range(T) | |
{ | |
ChunkedRange!char toChunkedRange() { return ChunkedRange!char(); } | |
} | |
struct ChunkedRange(T) { size_t itemsLeft; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment