---
title: "Tweede golf"
url: https://daily.dev/posts/tweede-golf-rzg98f4li
source_url: https://tweedegolf.nl/en/blog/135/mix-in-rust-with-c++
type: article
source: "Tweede golf"
published: 2026-05-31T07:54:01.258Z
updated: 2026-05-31T09:02:27.093Z
tags: ["rust", "c++"]
reading_time: 16
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tweede golf

**[Tweede golf](https://daily.dev/sources/tweedegolf)** · 16 min read · 0 upvotes · 0 comments

## Summary

A practical guide to introducing Rust into an existing C++ codebase using the `cxx` crate. Covers setting up the `#[cxx::bridge]` macro, declaring opaque types, exposing Rust methods to C++, handling limitations like consuming methods and unsupported types, and generating C++ bindings via `cxx-build`. Includes a working CRC32 hashing example with a C++ main function calling Rust code, plus a deep dive into the macro expansion to understand how `cxx` enforces safety at the FFI boundary.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tweedegolf.nl/en/blog/135/mix-in-rust-with-c++>

## Similar posts on daily.dev

- [The art of bridging Rust to Swift](https://daily.dev/posts/the-art-of-bridging-rust-to-swift-zshk8xytl) · Medium · 1 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#c++](https://daily.dev/tags/c++)

[View this post on daily.dev](https://daily.dev/posts/tweede-golf-rzg98f4li)
