Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、日付オブジェクトがあります。
boost::gregorian::date date1(2013,1,31);
ここで、日を 1 に変更したいと思います。日を 1 に設定するにはどうすればよいですか?
割り当てを除いて、日付型は不変であるため、新しい日付を作成する必要があります。
date1 = boost::gregorian::date(date1.year(), date1.month(), 1);