#include <iostream>

// use the preprocessor
#define PUBLIC_CONST( Type, Name, Initial_value ) \
    public: const Type& Name = Name##_ ; \
    private: Type Name##_ = Initial_value ;\
    public:

// or use a templated type holder
template < typename C, typename T > struct public_const_
{
    operator const T& () const { return v ; }
    private:
        T v ;
        T& operator()() { return v ; }
        public_const_( const T& vv = T() ) : v(vv) {}
        friend C ;
};

struct A
{
    void foo() { count_ = 9999 ; value() = 99.99 ; }

    PUBLIC_CONST( int, count, 1234 ) // preprocessor

    template < typename T > using public_const = public_const_<A,T> ;

    public_const<double> value = 12.34 ; // template
};

int main()
{
    A a ;
    std::cout << a.count << ' ' << a.value << '\n' ;

    a.foo() ;
    std::cout << a.count << ' ' << a.value << '\n' ;
}
