Hey, check this out:
#include <iostream>
struct Price { double x; };
struct Quantity { int x; };
void sendOrder(const char *symbol, bool buy, Quantity quantity, Price price) {
std::cout << symbol << " " << buy << " " << quantity.x << " " << price.x
<< std::endl;
}int main(void) {
sendOrder("GOOG", false, Quantity{100}, Price{1000.00}); // Correct
sendOrder("GOOG", false, Price{1000.00}, Quantity{100}); // compiler error
}If you're trying to get it to type check, you have to make a type first.
I don't appreciate these arguments, and view them as disingenuous.
replies(1):