That's very real. I'm a loser -- now and forever, and I don't know if I can keep programming because I'm so horrible, it seems. I keep trying the mindful meditation stuff but it's hard when you have people saying they're unhappy with your work and I have to get my (wrong) work checked all the time. I used to love working where I am but I get instantly tired as soon as I walk in the doors. I want to quit some days, others I want to press on. I'm trying to build something in my spare time so I can feel like a winner, at least once in my stupid life.
The options are keeping me here, and the sense that I shouldn't just quite yet. Maybe if I press on I'll survive, but if I never win and never quit it probably means I'm at my limits of what I'm capable of.
Its amazing what a difference it can make.
It also sounds like you need to get out there and find yourself a new challenge.
You say you have been doing C / C++ development work it should mean you have a good range of skills. Why not look for a new role using a different programming language. You need not be an expert but seeing as you can code most companies would be happy to have you.
It would offer you a good platform to renew yourself and make an impact in a different company.