Since everyone agrees, I'll disagree :).
Seriously though, there's nothing in ternary operator that says it should only be used for side-effect free code. Especially in C++ (or Java), which doesn't even differentiate between stateless and stateful code on the language level.
IMO ternary is a perfect solution for the case where you want to assign or return a different value based on a boolean condition. Whether or not the code in branches is side-effect free is irrelevant.
Personally, where I try to avoid using ternary operator, is places where I don't care about returned value. So "yes" for:
auto foo = [condition] ? possibly_stateful_then() : possibly_stateful_else();
no for:
[condition] ? then_statement() : else_statement();