LeetCode 906: Super Palindromes
The code wastes quite a few cycles rejecting palindromes less than lo_bound. It is not hard to find the smallest palindrome above lo_bound, and start from there.
If you are not comfortable constructing such palindrome, consider lifting the lead-in into the separate loop:
    long num = 1;
    while (num &lt; lo_bound) {
        num = make_next_palindrome(queue);
    }


The entire business around queue is very non-obvious, and it takes a great mental effort to realize that it iterates palindromes. I recommend to factor this logic out into a class of its own, along the lines of
class palindrome_iterator {
    std::queue&lt;...&gt; queue;
    // length, W, etc as necessary
public:
    palindrome_iterator(long start_num);
    long next();
};

This way the main loop is streamlined into
    palindrome_iterator p_i(lo_bound);
    for (long num = p_i.next(); num &lt; hi_bound; num = p_i.next()) {
        superpalindromes += is_palindrome(num * num);
    }

An additional (and possibly more important) benefit of such refactoring is that it enables unit testing of palindrome generation logic (which really sreams to be unit tested).

I strongly advise against -~length trick. length + 1 is much more clear, and for sure not slower.