sizeof() on custom library constructor returns wrong result
It is working perfectly correctly.

sizeof doesn't return the number of elements in an array, it returns the number of bytes the array takes up. Since each entry in your array is an instance of your DigitalOutput class, the size is the number of elements multiplied by the size of the class - in this case 10 bytes.

To get the number of elements you must divide the number of bytes by the size of one element:

int numEles = sizeof(LED_array) / sizeof(DigitalOutput);


or

int numEles = sizeof(LED_array) / sizeof(LED_array[0]);