From c34d6e06745ed8721ef803cc027fd1837a70b02c Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Wed, 18 Aug 2021 20:56:41 +0200 Subject: [PATCH] be explicit that not all implementations are immutable (fix #136) (#145) --- ARCHITECTURE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 639602020..64d713b51 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -72,7 +72,7 @@ Immutability is an alternative to several other strategies for safe intra-thread Immutability is implemented by the `Immutable` template, which acts as a non-nullable shared reference to a `const T`. It has behavior similar to `std::shared_ptr`, but indicates its intent as an immutable reference that is safe to share between threads. -Immutability is core to the implementation, and yet one of the defining features of Mapbox GL is the ability to manipulate and mutate the style freely at runtime. How can this be possible if everything is immutable? The answer turns on the distinction mentioned in the previous section between public classes such as `Layer` and private implementations such as `Layer::Impl`. In Mapbox GL, the latter is immutable, but the former is not: +Immutability is core to the implementation, and yet one of the defining features of Mapbox GL is the ability to manipulate and mutate the style freely at runtime. How can this be possible if everything is immutable? The answer turns on the distinction mentioned in the previous section between public classes such as `Layer` and private implementations such as `Layer::Impl`. In Mapbox GL the following private implementations are immutable, whereas their public counterparts are not: * **Mutable objects**: `Layer`, `Source`, `Image`, `Light` * **Immutable objects**: `Layer::Impl`, `Source::Impl`, `Image::Impl`, `Light::Impl`