File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,14 @@ To write a C++ function that returns a new object that can be garbage-collected
416
416
jlcxx::create<Class>(constructor_arg1, ...);
417
417
```
418
418
419
- This will return the new C++ object wrapped in a ` jl_value_t* ` that has a finalizer.
419
+ This will return the new C++ object wrapped in a ` jl_value_t* ` that has a
420
+ finalizer. The default constructor can be explicitly disabled by specializing
421
+ the ` DefaultConstructible ` type trait, for example:
422
+ ``` c++
423
+ namespace jlcxx {
424
+ template<> struct DefaultConstructible<Class > : std::false_type { };
425
+ }
426
+ ```
420
427
421
428
### Copy constructor
422
429
@@ -427,6 +434,14 @@ wvec = cpp_function_returning_vector()
427
434
julia_array = copy.(wvec)
428
435
```
429
436
437
+ It can be explicitly disabled for a type by specializing the ` CopyConstructible `
438
+ type trait, for example:
439
+ ``` c++
440
+ namespace jlcxx {
441
+ template<> struct CopyConstructible<Class > : std::false_type { };
442
+ }
443
+ ```
444
+
430
445
### Return values
431
446
If a wrapped C++ function returns an object by value, the wrapped object gets a finalizer
432
447
and is owned by Julia. The same holds if a smart pointer such as `shared_ptr` (automatically
You can’t perform that action at this time.
0 commit comments