# Hex-Rays: add C++ style casts into decompiler

**URL:** <https://community.hex-rays.com/t/hex-rays-add-c-style-casts-into-decompiler/800>\
**Category:** Feature requests\
**Tags:** ideas, cpp\
**Created:** [September 16, 2026, 7:10pm UTC](https://community.hex-rays.com/t/hex-rays-add-c-style-casts-into-decompiler/800 "2026-09-16T19:10:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![void\_17](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@void\_17](https://community.hex-rays.com/u/void_17)\
**Post date:** [September 16, 2026, 7:10pm UTC](https://community.hex-rays.com/t/hex-rays-add-c-style-casts-into-decompiler/800/1 "2026-09-16T19:10:44Z")

</div>

Since per my previous request some C++ style literal constants (namely, `nullptr`, `true`, `false`) were introduced into Hex-Rays decompiler, I would also like to request something that would complement this, that is, C++ style casts.

So that

```c
v2 = (uint)v1;

```

becomes

```cpp
v2 = static_cast<uint>(v1);

```

And

```c
ptr2 = (MyClass*)ptr1;

```

becomes

```cpp
ptr2 = reinterpret_cast<MyClass*>(ptr1);

```

Also, as an extension, it would be nice to have C++ bit casting (since C++20) instead of IDA `COERCE_` macros:

```c
v2 = COERCE_FLOAT(v1);

```

→

```cpp
v2 = std::bit_cast<float>(v1);

```

Or, to avoid dependency on when exporting pseudocode and forcing C++20 mode:

```cpp
v2 = __builtin_bit_cast(float, v1);

```

Allowing bit cast can be a separate option from allowing C++ casts in hex-rays options.  
Thanks!

---

<div class="post-metadata">

**Author:** ![yuiozank](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/yuiozank/32/293_2.png) [@yuiozank](https://community.hex-rays.com/u/yuiozank)\
**Post date:** [September 19, 2026, 11:04pm UTC](https://community.hex-rays.com/t/hex-rays-add-c-style-casts-into-decompiler/800/2 "2026-09-19T23:04:37Z")

</div>

Might I ask how is `ptr2 = reinterpret_cast<MyClass*>(ptr1);` more helpful than `ptr2 = (MyClass*)ptr1;` in decompiler for You ?
