### Question context :

While toying with godbolt about ways to recover compile-time contexts using runtime-value,  

(yeah, sounds like a bad idea), I found out a context where GCC evaluates `std::integral_constant<bool, value_arg>::value` strangely :

See the complete example on godbolt here : <https://godbolt.org/z/KzrK5xz3c>

***Disclaimer** : this code is so wrong in many ways, and is for illustration purpose only.*

As you may read, here the `std::integral_constant<bool, value_arg>::value` looks to instantiate the wrong symbols in both cases

```cpp
static_assert(argument_type::value == false); // fail
static_assert(argument_type::value == true);  // also fail !

```

```
<source>:39:44: error: static assertion failed
   39 |         static_assert(argument_type::value == true);
<source>:39:44: note: '(((int)std::integral_constant<bool, false>::value) == 1)' evaluates to false
<source>:38:44: error: static assertion failed
   38 |         static_assert(argument_type::value == false);
<source>:38:44: note: '(((int)std::integral_constant<bool, true>::value) == 0)' evaluates to false

```

However, the runtime check works as expected :

```cpp
if (not (argument_type::value == false))
   throw std::invalid_argument{"unexpected value"};

```

### **Q** : What point am I missing ?

Thanks for your time, and your love of C++.

### ***A*** : Use **overload** pattern for context specialisation

<https://godbolt.org/z/az5j3YMxz>

```cpp
template <class... Ts>
struct overload : Ts... { using Ts::operator()...; };

std::visit(overload{
        [](std::integral_constant<bool, false>){

        },
        []<typename integral_constant>(integral_constant &&){
           // integral_constant is `std::integral_constant<bool, true>` here  
           // as `std::integral_constant<bool, false>` will fall into the first argument of `overload`

           using argument_type = std::remove_reference_t<integral_constant>;
           static_assert(std::is_same_v<typename argument_type::value_type, bool>);
           static_assert(argument_type::value == true);
    }}, rt_cx::bridge<bool>[false]);

```