Test whether the edit-distance of two strings is at most 1
It looks like you either imported std::string or the whole standard namespace into the global namespace.
It's ok to do the former in implementation-files, though I would desist as it doesn't gain you all that much in brevity.
If it's the latter, read "Why is “using namespace std;” considered bad practice?" and change it.
Avoid allocating memory. Doing so is slow and can fail. That means accepting the arguments by constant reference, not using temporary copies, and not modifying the arguments.
If you had C++17, it would mean changing to std::string_view for the added flexibility.
Prefer using auto to a more complicated expression using decltype. It's less error-prone, more readable, and also shorter.
&lt;algorithm&gt; contains std::min(). Using that is more readable, shorter and no less efficient than writing it out using the conditional-operator.
Did you test ("abc", "b")? That's two deletions edit-distance, but will be accepted anyway.
Keep your line-length reasonable. Horizontal scrolling kills readability.


Using all that, but staying true to C++11:

#include &lt;string&gt;
#include &lt;algorithm&gt;

bool oneAway(const std::string&amp; a, const std::string&amp; b) noexcept {
    if (a.size() &gt; b.size())
        return oneAway(b, a);
    if (b.size() - a.size() &gt; 1) // No need to look further, pure optimization
        return false;
    auto begin = std::mismatch(a.begin(), a.end(), b.begin());
    using reverse_it = decltype(a.rbegin()); // std::make_reverse_iterator is C++14
    auto end = std::mismatch(a.rbegin(), reverse_it(begin.first), b.rbegin());
    return end.second.base() - begin.second &lt; 2;
}


And for testing:

#include "one_away.h"
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;

static bool do_test(const std::string&amp; a, const std::string&amp; b, bool expected) {
    bool r = oneAway(a, b);
    std::cout &lt;&lt; (r == expected ? "[OK] " : "[FAIL] ")
        &lt;&lt; std::boolalpha &lt;&lt; r &lt;&lt; " \"" &lt;&lt; a &lt;&lt; "\" \"" &lt;&lt; b &lt;&lt; \"\n";
    return r == expected;
}

static bool test(const std::string&amp; a, const std::string&amp; b = a, bool expected = true) {
    bool r = do_test(a, b, expected);
    if (a != b)
        r &amp;= do_test(b, a, expected);
    return r;
}

int main() {
    bool r = test("");
    r &amp;= test("abc");
    r &amp;= test("pale", "ple");
    r &amp;= test("pales", "pale");
    r &amp;= test("pale", "bale");
    r &amp;= test("pale", "bake", false);
    r &amp;= test("abc", "b", false);
    std::cout &lt;&lt; (r ? "[OK]\n" : "[FAIL]\n");
    return r ? 0 : EXIT_FAILURE;
}