From a7682325a21cd8b23f5dd03a28814f0933509a82 Mon Sep 17 00:00:00 2001 From: Juan M Gómez Date: Fri, 9 Jun 2023 08:55:24 +0100 Subject: fixes typos in the constructor docs (#22035) * fixes typos in the constructor docs * updates constructor docs * Update doc/manual_experimental.md --------- Co-authored-by: Andreas Rumpf --- doc/manual_experimental.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/manual_experimental.md b/doc/manual_experimental.md index 4e838d65d..54354f92b 100644 --- a/doc/manual_experimental.md +++ b/doc/manual_experimental.md @@ -2207,10 +2207,10 @@ NimPrinter().printConstRef(message, val) ``` -constructor pragma +Constructor pragma ================== -The `constructor` pragmas has two ways of being used: in conjunction with `importcpp` to import a C++ constructor and as a way to declare constructors that works similarly to `virtual`. +The `constructor` pragma can be used in two ways: in conjunction with `importcpp` to import a C++ constructor, and to declare constructors that operate similarly to `virtual`. Consider: @@ -2263,4 +2263,4 @@ proc makeCppClass(): NimClass {.constructor: "NimClass() : CppClass(0, 0)".} = In the example above `CppClass` has a deleted default constructor. Notice how by using the constructor syntax, one can call the appropiate constructor. -Notice when calling constructor in a global variable, it will be called before `NimMain` meaning Nim is not fully initialized. \ No newline at end of file +Notice when calling a constructor in the section of a global variable initialization, it will be called before `NimMain` meaning Nim is not fully initialized. -- cgit 1.4.1-2-gfad0