X-Git-Url: http://nitlanguage.org diff --git a/lib/cpp.nit b/lib/cpp.nit index 6fe897a..f5c1a19 100644 --- a/lib/cpp.nit +++ b/lib/cpp.nit @@ -14,9 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Offers features to interface with C++ code and libraries +# Services for compatibility with C++ code and libraries module cpp is - new_annotation cpp_compiler_option + new_annotation cppflags end # A pointer to a C++ std::string instance @@ -28,9 +28,9 @@ redef class Text fun to_cpp_string: CppString do return to_cstring.to_cpp_string(length) end -redef class NativeString +redef class CString # Get `self` as a `CppString` fun to_cpp_string(length: Int): CppString in "C++" `{ - return new std::string(recv, length); + return new std::string(self, length); `} end