| /++ |
| REQUIRED_ARGS: -HC=verbose -c -o- -d |
| PERMUTE_ARGS: |
| TEST_OUTPUT: |
| --- |
| // Automatically generated by Digital Mars D Compiler v$n$ |
| |
| #pragma once |
| |
| #include <assert.h> |
| #include <math.h> |
| #include <stddef.h> |
| #include <stdint.h> |
| |
| #ifdef CUSTOM_D_ARRAY_TYPE |
| #define _d_dynamicArray CUSTOM_D_ARRAY_TYPE |
| #else |
| /// Represents a D [] array |
| template<typename T> |
| struct _d_dynamicArray final |
| { |
| size_t length; |
| T *ptr; |
| |
| _d_dynamicArray() : length(0), ptr(NULL) { } |
| |
| _d_dynamicArray(size_t length_in, T *ptr_in) |
| : length(length_in), ptr(ptr_in) { } |
| |
| T& operator[](const size_t idx) { |
| assert(idx < length); |
| return ptr[idx]; |
| } |
| |
| const T& operator[](const size_t idx) const { |
| assert(idx < length); |
| return ptr[idx]; |
| } |
| }; |
| #endif |
| #if !defined(_d_real) |
| #define _d_real long double |
| #endif |
| |
| class WithImaginary |
| { |
| public: |
| float memberIf; |
| double memberId; |
| _d_real memberIr; |
| _Complex float memberCf; |
| _Complex double memberCd; |
| _Complex _d_real memberCr; |
| _d_dynamicArray< float > nested; |
| // Ignored function dtoh_ignored.WithImaginary.onReturn because its return type cannot be mapped to C++ |
| private: |
| virtual void __vtable_slot_0(); |
| // Ignored function dtoh_ignored.WithImaginary.onParam because one of its parameters has type `ifloat` which cannot be mapped to C++ |
| virtual void __vtable_slot_1(); |
| }; |
| |
| template <typename T> |
| struct WithImaginaryTemplate final |
| { |
| float member; |
| // Ignored function onReturn because its return type cannot be mapped to C++ |
| // Ignored function onParam because one of its parameters has type `ifloat` which cannot be mapped to C++ |
| // Ignored variable onVariable because its type cannot be mapped to C++ |
| WithImaginaryTemplate() |
| { |
| } |
| }; |
| |
| extern WithImaginaryTemplate<int32_t > instance; |
| |
| // Ignored variable dtoh_ignored.onVariable because its type cannot be mapped to C++ |
| // Ignored variable dtoh_ignored.onVariablePointer because its type cannot be mapped to C++ |
| // Ignored variable dtoh_ignored.onVariableSlice because its type cannot be mapped to C++ |
| // Ignored variable dtoh_ignored.onVariableArray because its type cannot be mapped to C++ |
| extern void* onVariableAssocArray; |
| |
| // Ignored variable dtoh_ignored.onVariableFunction because its type cannot be mapped to C++ |
| // Ignored variable dtoh_ignored.onVariableFunctionParam because its type cannot be mapped to C++ |
| // Ignored variable dtoh_ignored.onVariableDelegate because its type cannot be mapped to C++ |
| // Ignored function dtoh_ignored.myExit because its return type cannot be mapped to C++ |
| --- |
| +/ |
| |
| extern (C++): |
| |
| class WithImaginary |
| { |
| ifloat memberIf; |
| idouble memberId; |
| ireal memberIr; |
| |
| cfloat memberCf; |
| cdouble memberCd; |
| creal memberCr; |
| |
| ifloat[] nested; |
| |
| ifloat onReturn() |
| { |
| return 0i; |
| } |
| |
| void onParam(ifloat) {} |
| } |
| |
| struct WithImaginaryTemplate(T) |
| { |
| ifloat member; |
| |
| ifloat onReturn() |
| { |
| return 0i; |
| } |
| |
| void onParam(ifloat) |
| { |
| } |
| |
| __gshared ifloat onVariable; |
| } |
| |
| __gshared WithImaginaryTemplate!int instance; |
| |
| __gshared ifloat onVariable; |
| |
| __gshared ifloat** onVariablePointer; |
| |
| __gshared ifloat[] onVariableSlice; |
| |
| __gshared ifloat[2] onVariableArray; |
| |
| __gshared ifloat[int] onVariableAssocArray; |
| |
| __gshared ifloat function() onVariableFunction; |
| |
| __gshared void function(ifloat) onVariableFunctionParam; |
| |
| __gshared ifloat delegate() onVariableDelegate; |
| |
| noreturn myExit() |
| { |
| assert(false); |
| } |