The question says it. [thread.jthread.stop]/1 says:
[[nodiscard]] stop_source get_stop_source() noexcept;
Effects: Equivalent to:
Why is it not a pure observer?
stop_source object allows you to request that the thread which has such an object (or its attendant
stop_token) perform a stop. Such a request is not logically
const. As such, if you fetch a
stop_source for a
jthread, it is expected that you are going to perform the aforementioned “not logically
So the function you used to retrieve it is not
const. Note that getting a
const, as this is an observer of thread-safe state, not a modifier of it.