Posts

Showing posts from November 22, 2018

Continuity from below of outer measure extending an algebrea

Image
up vote 1 down vote favorite 1 Consider the following problem: Let $mathcal{A}$ be an Algebra with an additive function $mu$ and let $mu^*$ be the outer measure corresponding to $mu$ . Show that if $A_nuparrow A$ then $mu^*(A_n)rightarrow mu^*(A)$ . After much effort I've crafted this attempt at a solution: For every $n$ we have a cover by sets from $mathcal{A}:space{P_{n,i}}^{infty}_{i=1}$ such that $sum_{i}mu(P_{n,i})<mu^*(A_n)+epsilon$ . We then also have a $k_n$ such that: $$sum_{i=k_n+1}^{infty}mu(P_{n,i})<frac{epsilon}{2^n}$$ We will also define $$R_n:=bigcup_{i=1}^{k_n} P_{n,i}inmathcal{A}$$ We then have: $$Asubseteqbigcup_{n=1}^{infty}(R_nsetminusbigcup_{j=1}^{n-1}R_j)cupbigcup_{n=1}^{infty}bigcup_{i=k_n+1}^{infty}P_{n,i}$$ And so by additivity of $mu$ : $$mu^*(A)leqs

Why does the compiler prefer f(const void*) to f(const std::string &)?

Image
up vote 40 down vote favorite 8 Consider the following piece of code: #include <iostream> #include <string> // void f(const char *) { std::cout << "const char *"; } // <-- comment on purpose void f(const std::string &) { std::cout << "const std::string &"; } void f(const void *) { std::cout << "const void *"; } int main() { f("hello"); std::cout << std::endl; } I compiled this program using g++ (Ubuntu 6.5.0-1ubuntu1~16.04) 6.5.0 20181026 : $ g++ -std=c++11 strings_1.cpp -Wall $ ./a.out const void * Note that the comment is there on purpose to test, otherwise the compiler uses f(const char *) . So, why does the compiler pick f(const void*) over f(const std::string &) ?