I had my hip replace in my late thirties in 1988. I was very active after the surgery. However, I think doing roofing could be very dangerous.
The squatting/kneeling position is a no-no. You can't be twisting your leg around because you would likely have a dislocation. One mistake- not paying attention to what your lower body is doing- and you could dislocate and probably fall off the roof. I've dislocated twice in the hospital and it is excruciatingly painful.
I wouldn't recommend roofing as I wouldn't recommend laying carpet.
The only one that can really answer your question is your OS. So much depends on your physical condition pre surgery including your strength and the condition of your hips, your surgeon's experience, the type of surgery and prothesis used and your willingness to rehab.
I had both hips relaced in May '05 and do belive I could physically be able to do the work of a roofer. But it may take a while to get there. I did just spend 7 hrs straight on our 6/12 and 8/12 roofs, shoveling 4' of snow and hammering ice off following a huge storm. I was exhausted after, but my hips were great. I have very strong muscles which help to hold my new joints in place and my OS feels that it would be nearly impossible for me to dislocate at this point, but everyone and every situation is different. Good luck!