Rapid adaptation in complex demographic scenarios