I'm almost certain this program won't compile because of these lines:
assignCodes(map, *rootNode.left, currWord << 1, depth + 1);
assignCodes(map, *rootNode.right, (currWord << 1) | 1, depth + 1);
rootNode is not a pointer so it cannot be dereferenced. Also, while we're at it, there'sThere's really no need to do all that bit manipulation when you can simply do:
assignCodes(map, *(rootNode.left), currWord * 2, depth + 1);
assignCodes(map, *(rootNode.right), currWord * 2 + 1, depth + 1);
EDIT: I would also put parenthesis around the expression that the * operator is supposed to dereference to make it clearer as I've done above. A similar syntactical fix needs to be done in decodeMessage() too.
std::string ret;
ret.reserve(message.size()); // reserve memory up front to avoid deallocations repeated allocations
for (const auto& c : message) {
ret += map[c];
}