Fix Issue 12315 - `array` at compile-time with all types

Problem was that `emplaceRef` calls `memcpy` for some types, which is unsafe and unavailable at compile time.

https://d.puremagic.com/issues/show_bug.cgi?id=12315
Merge pull request #1986 from Poita/bug12315

Fix Issue 12315 - `array` at compile-time with all types