SFINAE в C++

Привет, Хабр! Сегодня я хочу поговорить про SFINAE, загадочную аббревиатуру из C++. Расшифровывается SFINAE не менее загадочно: Substitution Failure Is Not An Error , по-русски: «неудавшаяся подстановка — не ошибка». Сейчас рассмотрим, почему это правило появилось, как оно работает и как мы можем использовать его себе во благо. К механике SFINAE

https://habr.com/ru/companies/otus/articles/971354/

#C++ #шаблонная_метапрограммирование #шаблоны #SFINAE #перегрузка_функций #типы_в_C++ #метапрограммирование #компиляция

SFINAE в C++

Привет, Хабр! Сегодня я хочу поговорить про SFINAE, загадочную аббревиатуру из C++ . Расшифровывается SFINAE не менее загадочно: Substitution Failure Is Not An Error , по-русски: «неудавшаяся...

Хабр

Chàng trai 19 tuổi đam mê thiết kế game engine, đặc biệt là ECS. Anh ấy đang thử nghiệm SFINAE, template metaprogramming, variadic programming, CRTP/SRTP và kiến trúc engine. Rất mong nhận được phản hồi và thảo luận về code!
#gameengine #ECS #SFINAE #CRTP #gamedevelopment #lậptrìnhgame #phattriengame #congnghe

https://www.reddit.com/r/programming/comments/1pbw6d8/19yearold_dev_diving_into_ecs_sfinae_crtp/

Chàng trai 19 tuổi chia sẻ về hành trình khám phá ECS, SFINAE và CRTP trong thiết kế game engine. Dự án GitHub của anh tập trung vào metaprogramming, variadic programming, static polymorphism và kiến trúc ECS. Anh mong muốn nhận được feedback và thảo luận về code/design.
#laptrinh #gameengine #ECS #SFINAE #CRTP #programming #vietdev

https://www.reddit.com/r/programming/comments/1pbw6d8/19yearold_dev_diving_into_ecs_sfinae_crtp/

Wrote a new blog post: https://solidean.com/blog/2025/sfinae-concepts-static-assert-modern-cpp/

We're modernizing some of our internal C++ libraries and I looked at how we want to move SFINAE over to concepts/requires.

spoiler: it's not gonna be "requires requires"

#cpp #sfinae #templates

C++20 Template Constraints: SFINAE to Concepts | Solidean

Comparing eleven constraint patterns for template functions in C++20, with a focus on symbol size, readability, and when to choose each approach

Solidean

Concepts and sfinae are conspiring against me pls help 😭

#cplusplus #cpp #SFINAE

C++Now 2025 SESSION ANNOUNCEMENT: A View for Any Occasion by Patrick Roberts

https://schedule.cppnow.org/session/2025/a-view-for-any-occasion/

Register now at https://cppnow.org/registration/

#APIs #programming #sfinae #typeerasure

A View for Any Occasion – C++Now Schedule

C++Now 2025 SESSION ANNOUNCEMENT: A View for Any Occasion by Patrick Roberts

https://schedule.cppnow.org/session/2025/a-view-for-any-occasion/

Register now at https://cppnow.org/registration/

#APIs #programming #sfinae #typeerasure

A View for Any Occasion – C++Now Schedule

The latest feature for #FormaK: a managed #KalmanFilter runtime!

I'd been stuck trying to simplify the complexity of managing a process and multiple sensor models since I introduced calibration (which added more complexity... not helping...). In the end I landed on a single tick function call with a dose of #SFINAE that handles sensors of any type and takes care of the rest under the hood.

As always, it comes in #Python and #Cpp

Github: https://github.com/buckbaskin/formak/pull/17

FormaK Runtime: "ManagedFilter" by buckbaskin · Pull Request #17 · buckbaskin/formak

FormaK aims to combine symbolic modeling for fast, efficient system modelling with code generation to create performant code that is easy to use. The Five Key Elements the library provides to achie...

GitHub

New feature launch for #FormaK: a managed #KalmanFilter runtime!

I'd been stuck trying to simplify the complexity of managing a process and multiple sensor models since I introduced calibration (which added more complexity... not helping...). In the end I landed on a single tick function call with a dose of #SFINAE that handles sensors of any type and takes care of the rest under the hood.

As always, it comes in #Python and #Cpp

Blog: https://buckbaskin.com/blog/formak-runtime-new-formak-feature.html
Github: https://github.com/buckbaskin/formak/pull/17

FormaK Runtime - New FormaK Feature - Building and Breaking

<p>A new feature for FormaK has landed: The FormaK runtime. The first tool in the runtime is a Managed Filter that handles coordinating process and sensor updates.</p>

False! In some situation, using deduced return type will cause the compiler to instanciate the body of the function, and in my case it was happening a lot with concepts since I checked everything.

Suddently, I had a bunch of instanciated functions that shouldn't have, and try to called (purposefully) unimplemented functions. Those were causing compilation errors where it shouldn't

#cpp #sfinae