Skip to content

[SR-13261] [C++] Allow instantiating C++ templates from Swift #55701

Open
@swift-ci

Description

@swift-ci
Previous ID SR-13261
Radar rdar://problem/83423218
Original Reporter hlopko (JIRA User)
Type New Feature
Status In Progress
Resolution
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels New Feature, CxxInterop
Assignee scentini (JIRA)
Priority Medium

md5: 55b08f175ae8509127468b5b5b9af809

Issue Description:

I.e. allow using following C++ header:

template<class T>
struct Tpl {
  inline int callMethod() const {
    return T::method();
  }
};

struct Arg {
  static int method() { return 6; }
};

in Swift like:

print(Tpl<Arg>().callMethod())

In the initial version we'll only support passing C++ types as template arguments, plus a small hardcoded set of Swift primitive types (converted to corresponding C++ types behind the scenes).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions