Question: I saw this answer.

<https://stackoverflow.com/a/47317853/8106257>

But, I don't satisfying logical const.

Is there any other way to sort custom class object with const member variable?

I was firstly thought that how about using move constructor but it didn't work.

```
#include <iostream>
#include <vector>
#include <algorithm>

class City
{
private:
    const int _cost;
    const int _customer;

public:
    City(int cost, int customer) : _cost(cost), _customer(customer)
    {

    }
    City(const City&& city) : _cost(city._cost), _customer(city._customer)
    {

    }
    City& operator=(const City& city) = delete;
    bool operator<(const City& city) const
    {
        return false;
    }
};
struct Comparator
{
    bool operator()(const City& l, const City& r) { return l < r; }
};

int main()
{
    int C, N;
    std::cin >> C >> N;

    std::vector<City> vec;
    for(int i = 0; i < N; ++i)
    {
        int cost, customer;
        std::cin >> cost >> customer;
        vec.emplace_back(cost, customer);
    }

    sort(vec.begin(), vec.end(), Comparator());
}

```

Answer: 
Make sure you annotate your Application class to initialise Hilt

```
@HiltAndroidApp
class App : Application()

```

Your Application class needs to be registered in the manifest if it isn't already.

```
<application
        android:name=".App"
        ... />

```

You also need to annotate your activities and fragments so that Hilt can inject into them.

```
@AndroidEntryPoint
class MainActivity

```
Add `@AndroidEntryPoint` annotation in main activity

```
@AndroidEntryPoint // this line 
class MainActivity : ComponentActivity() {

    private val mainViewModel: MainViewModel by viewModels()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            KotlinReadExstingRoomDBTheme {
                MyApp()
            }
        }
    }

```