boost-ext / sml

C++14 State Machine library
https://boost-ext.github.io/sml
Boost Software License 1.0
1.16k stars 179 forks source link

sm.is("state"_s) suddenly doesn't compile anymore #593

Closed Bracket-H closed 1 year ago

Bracket-H commented 1 year ago

Expected Behavior

It compiles and works

Actual Behavior

error: unable to find string literal operator ‘operator""_s’ with ‘const char [3]’, ‘long unsigned int’ arguments

Steps to Reproduce the Problem

  1. No idea :(

using g++ 13.2.0 with std c++17

It works if I copypaste an example into its own little file and compile that. My own thing just doesn't compile anymore even though the states are defined, and everything compiles and works the "is" method just is suddenly borked and I don't know why...

In fact, I just deleted my own code and copy pasted the working example code which I successfully compiled and ran in its own file as a replacement and I still get that error now.

Got any ideas?

Bracket-H commented 1 year ago

Wait...what... using namespace sml (after defining it as boost::sml) fixed it.

Since I didn't know what happened I intentionally broke the compilation by adding a class to the string thing. like sm.is("s1"_s + foo) and it spat

In instantiation of ‘constexpr auto boost::ext::sml::v1_1_8::front::state_impl<TState>::operator+(const T&) const [with T = Foo; TState = boost::ext::sml::v1_1_8::front::state<boost::ext::sml::v1_1_8::aux::string<char, 's', '2'> >]’:

at me.

so ...how would I emulate this without using namespace sml?!

Cause neither sml::is or sml.is(sml::"s2"_s) or sml.is("s2"sml::_s) works.

What kind of black magic is this.

I assume this is part of the contrivances behind "on the fly state/event creation" as per the tutorial

https://boost-ext.github.io/sml/tutorial.html

auto idle = sml::state<class idle>;

But, man, this threw me, and still is throwing me for a loop. Hnghhhhhhhhhhhhhh.

Bracket-H commented 1 year ago

Man, the workshop slide is total ass and chips, man.

/ On the fly declaration (default)
using namespace sml;
"Diconnected"_s

Diconnected misspelled, and doesn't even compile 'on its own like that' And neither does

// Standard declaration
sml::state<class Connecting>{};

Throwing template sml::blabla I'm getting tired of this horseshit does not name a template something or other.

This works

            return make_transition_table(
                    *"idle"_s + event<OmgFucker> / [] { std::cout << "REEEEE"  << '\n'; } = sml::state<class s2>
                    , sml::state<class s2>  + event<OmgFucker>   / [] { std::cout << "external transition" << std::endl; } = X
                    );

the sml::state<class s2> thing works in the make transition table thing.

but assert(sm.is(sml::state<class s2>));

Does not.

Why? What? How?

Is this my fault for not just following the convention with blinkers on, going and just "using namespace sml blabla"?

Why does it have to be always this fucking obtuse, makes me feel extra retarded because 'everyone else seems to be able to use it just fine'.

What the hell, man? Pissing me off.

Don't put bullshit into your damn workshop tutorial slide, and if you do, make sure to explain it both, fuck, man. Fucking autists. I'm not in the mood to spend a fucking month trying to learn your horseshit, man. Just because you're trying to be cute.

EXPLAIN. YOUR. WORK.

I can't read your autismal "I studied 10 years at gender studies CS university of Karl Marx Pound My ass where I learned this" mind.

Bracket-H commented 1 year ago

And why does the documentation flat out lie about not needing anything other than one header? This clearly doesn't seem to be the case with the dispatching examples.

In the user guide, "dispatchable" as a concept shows two buttons for examples. The first "run dispatchable example" is 404 The second brings up the SDL example which uses the utility header.

So...what is it? This projects documentation DOES seem to assume that I can read the minds of malicious metaprogramming men, cause if I followed the documentation as is I'd be SOL.

And by the way, the search function is also 404. Joking around at my expense. I think I'm warranted some disgruntlement.

Bracket-H commented 1 year ago

And there's a 'practical example' about making a game, but it's a web game and the talk is over an hour and it mixes in mobile stuff and "javascript", bringing degenerate mobile webshite into the mix.

Why. Why do you do this? Why the hell do you make a practical example that then goes into webshittery. Rethorical question, it's related to: "I studied 10 years at gender studies CS university of Karl Marx Pound My ass where I learned this"

I'm surprised I'm not banned for this yet, but I figure it will happen. Sooner rather than later. I am deriding Marx after all. And web development. And metaprograming. And bullshit.

Bracket-H commented 1 year ago

Yeah, fuck all of this and fuck your documentation. Enjoy your 1byte heap allocated superpowers IN INT MAIN. Sayonara, suckers. I'm going back to if else.