cppalliance / safe-cpp

Boost Software License 1.0
191 stars 14 forks source link

Choice bug - can't initialize from alternative name in dependent choice type #43

Closed seanbaxter closed 2 months ago

seanbaxter commented 2 months ago
#feature on safety

template<class T+>
choice optional
{
  default none,
  some(T);

  optional<T> do_it() {
    return optional<T>::none();
  }
};

int main()  {
  optional<int> opt = .some(1234);
  auto x = opt.do_it();
}
seanbaxter commented 2 months ago

Fixed in build_sep_10_2024-1.tgz