At common law, railroads were under no obligation to fence their rights of way. Chapin v. Railroad, 39 N.H. 53, 57, and cases cited.
The statute provides that "the proprietors of every railroad shall erect and maintain a sufficient fence upon each side of their road." P. S., c. 159, s. 23. But this statute is for the benefit of the owner or occupant of the adjoining land. It confers no rights upon the general public. Hill v. Railroad, 67 N.H. 449, and cases cited. The fact that the plaintiff was a child does not alter the case. "The fact that the trespasser *Page 650 is an infant cannot have the effect to raise a duty where none otherwise exists." Frost v. Railroad, 64 N.H. 220. If landowners do nothing to a trespasser, if they let him entirely alone, he will have no cause of action against them for injuries that he may receive. Buch v. Company, ante, p. 257.
The declaration does not allege a breach of any duty which the defendants owed to the plaintiff. They were not bound to anticipate his trespass, nor to take precautionary measures to prevent it.
Demurrer sustained.
All concurred.