(cross-post from Reddit )
I thought I'd implement a copy of arrayvec
which uses true Const Generics instead of a helper Array
trait, and as I'm going I've been writing down the decisions and assumptions I make in blog post form.
The code is about 80% unsafe
, so it'd be nice to have a second pair of eyes look over the blog post and/or crate.
The Blog Post:
---
title: "Implementing ArrayVec Using Const Generics"
date: "2019-11-15T00:57:00+08:00"
tags:
- Rust
---
If you've ever done much embedded programming in Rust, you've most probably run
across the [`arrayvec`][arrayvec] crate before. It's awesome. The main purpose
of the crate is to provide the `ArrayVec` type, which is essentially like
`Vec<T>` from the standard library, but backed by an array instead of some
memory on the heap.
One of the problems I ran into while writing the *Motion Planning* chapter of my
[Adventures in Motion Control][aimc] was deciding how far ahead my motion
planner should plan.
The *Adventures in Motion Control* series is targeting a platform without an
allocator, so the number of moves will be determined at compile time. I *could*
pluck a number out of thin air and say *"she'll be right"*, but there's also
This file has been truncated. show original
The Code:
1 Like
droundy
November 12, 2019, 5:50pm
2
The link to your blog post that is in the readme is broken.
system
Closed
February 10, 2020, 6:05pm
3
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.