I'm trying to do a command loop but cin isn't blocking and it just loops until crashes.


Code:
public:
    void loop()
    {
        std::string selection;
        cout << "Initializing Manual Sampler Thread" << endl;
        while(true)
        {
        
            cout << "Command>" << endl;
            
            std::string selection;
            //std::getline(std::cin, selection);
            cin >> selection;
            
            
            cout << selection;
        }
            
        
    }