- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
import std.io;
import std.string;
import calendar.month;
module calendar.date;
namespace Chrono
{
export
struct Date {
Date(int, Month, int);
int day() const
{
return d;
}
Month month() const
{
return m;
}
Int year() const
{
return y;
}
private:
int d;
Month m;
int y;
};
export
std::ostream &operator<<(std::ostream &, const Date &);
export
std::string to_string(const Date &);
}
export
export
export
export
export
Не могли что-то более удобное придуать? Глаза же режет, а каждый раз это ручками писать...
Всё лучше, чем всякое говно типа __declspec(dllexport) или __attribute__((dllexport)).
чтобы тот же заголовок потом и заимпортить
Да и между разными компиляторами толком не работает без extern "C"...
Мелкософт, как всегда, решил сделать всё по своему.
нафиг-нафиг