cudamemcpy objects from host to device/GPU

Assume there are classes of the following types (A and B)

class A

{

private:

   int   a[100];

   char  b[100];

public:

   void func_a() { } 

   void func_b() { }

};

class B : public A

{

private:

   int  c[100];

public:

   void func_c() { }

   void func_d() { }

};

Question:

Is it allowed and valid to directly copy object of Type B from Host to Device in the following way ?

__device__ B d_b;

B h_b;

main()

{

...

cudaMemcpyToSymbol("d_b", h_b, sizeof(B), 0, cudaMemcpyHostToDevice);

...

}