I am trying to figure out details of the syntax of Swift statements that utilize the C++ Standard Library. I understand the C++ Standard Library can be used in Swift if one first sets the compiler language interoperability setting to āC++/Objective-Cā and then begins with the import CxxStdlib statement.
There is a cross-reference of Swift and C++ data types at: Swift.org - Supported Features and Constraints of C++ Interoperability but not all those C++ types worked for me when I tried them. Some examples are below.
Below are my tests of several of the data types along with the error messages I am getting.
import CxxStdlib
let s0: std.string = "some_text" // works ok
let i0: std.int32_t = 5 // works ok
let i1: std.int32_t = 5 // works ok
let d0: std.float = 5.5 // 'float' is not a member type of enum
let d0: std.double = 5.5 // 'double' is not a member of type enum
let v0: std.vector // 'Consecutive statements on a line must be separated by a ;
What syntax do I need to use to make functional the ones that do not work?