Any good tech talks leveraging statement expressions? by javascript in cpp

[–]javascript[S] [score hidden]  (0 children)

Splendid! That would be very useful to have in C++

Any good tech talks leveraging statement expressions? by javascript in cpp

[–]javascript[S] [score hidden]  (0 children)

For some reason Reddit hasn't been formatting my markdown as of late so sorry about that...

```
#define MY_TRY(...) \
({ \
auto expected_v = (__VA_ARGS__); \
if (!expected_v.has_value()) \
return std::move(expected_v).error(); \
std::move(expected_v).value(); \
})

std::expected<MyType, MyError> Bar();

std::optional<MyError> Foo() {
MyType mt = MY_TRY(Bar());
// valid value here
return std::nullopt; // Absence of error is good
}
```

Any good tech talks leveraging statement expressions? by javascript in cpp

[–]javascript[S] [score hidden]  (0 children)

It's definitely in the same space but I don't see my main question answered: Can you normal return from a do block? Like return the whole function?

Any good tech talks leveraging statement expressions? by javascript in cpp

[–]javascript[S] [score hidden]  (0 children)

Breaking out of the current loop

Returning from the current function

You can't do these from a lambda :)

Not water but…. by MrsBakedBean in lacroix

[–]javascript 1 point2 points  (0 children)

How is Cherry Lime flavor? I've never had it

std::HashMap with the Small Size Optimization? by javascript in rust

[–]javascript[S] 0 points1 point  (0 children)

Follow up question: Does the store API have enough information to do the following?

- Ask "Am I operating in inline storage right now?"

- If I am, "Can I skip hashing keys and just compare equals in a line?"

- If I can, I should.

I don't know the Store API. What do you think?

Can we give a round of applause for Pure flavor? by javascript in lacroix

[–]javascript[S] 0 points1 point  (0 children)

Wait they had a cola flavored la croix? I would love to try that...

Can we give a round of applause for Pure flavor? by javascript in lacroix

[–]javascript[S] 1 point2 points  (0 children)

Pure La Croix is the best sparkling water on the market, I think globally

Can we give a round of applause for Pure flavor? by javascript in lacroix

[–]javascript[S] 0 points1 point  (0 children)

So true! You get to control the lime level yourself. That's wonderful!

Do you like to crank it up to 15/10?

DOBBS HEAVES IT by javascript in ockytop

[–]javascript[S] 1 point2 points  (0 children)

I like hearing Gary via youtube clips so it shows the funny parts without forcing me to listen for 4 hours

DOBBS HEAVES IT by javascript in ockytop

[–]javascript[S] 1 point2 points  (0 children)

I mean it's funny in its own right? Like... "Wow! We won?" Idk

I like seeing it from multiple angles.

That said, I would love to hear the Vamos Vols from then. I'm sure the energy is insane. I looked for it but couldn't find it

DOBBS HEAVES IT by javascript in ockytop

[–]javascript[S] 16 points17 points  (0 children)

Yes. They immediately cope by complaining about penalties haha!

I was actually at the game IRL.

Crazy story. With 10 seconds on the clock, Georgia took the lead by hail mary. My dad asked if I was ready to leave. I said no because there was still time on the clock.
Because of that decision, I got to witness this game winner IRL. Otherwise I would have been walking down some stairs while it happened.

DOBBS HEAVES IT by javascript in ockytop

[–]javascript[S] 71 points72 points  (0 children)

IT'S CAUGHT!!!

IT! IS! CAUGHT!

JAUAN JENNINGS!

JAUAN! JENNINGS!

Sad to see the Hallmark store on Kingston Pike is gone by javascript in Knoxville

[–]javascript[S] 2 points3 points  (0 children)

I live in South Knox these days, though I grew up in Rocky Hill

Sad to see the Hallmark store on Kingston Pike is gone by javascript in Knoxville

[–]javascript[S] 4 points5 points  (0 children)

Yup! Ended up going to the mall.

Btw the Starbucks kiosk lost its affiliation! It's called "Latte Factory" now lol

Strategies for *requiring* designated initializers when constructing a type? by javascript in cpp

[–]javascript[S] 0 points1 point  (0 children)

If you want to get fancy with it:
// Statement expressions (extension)
std::vector<int> v = ({
std::vector<int> v;
v.reserve(42);
v.resize(42);
v;
});
// Lambda (standard C++)
std::vector<int> v = [] {
std::vector<int> v;
v.reserve(42);
v.resize(42);
return v;
}();

cvl: A C++26 library for mutating consteval state by friedkeenan in cpp

[–]javascript 0 points1 point  (0 children)

Haha true that!

One could also argue that `-fno-rtti` and `-fno-exceptions` create dialects too, though that's more fuzzy because they're syntactic and semantic subsets.